ID:2061611
 
Not Feasible
BYOND Version:509
Operating System:Windows 10 Home 64-bit
Web Browser:Chrome 49.0.2623.87
Applies to:Dream Maker
Status: Not Feasible

Implementing this feature is not possible now or in the foreseeable future
Descriptive Problem Summary:
Any embedded expression will make the compiler assume that a string is not constant, even if the expression is clearly constant.

Numbered Steps to Reproduce Problem:
Attempt to compile the code below.
Code Snippet (if applicable) to Reproduce Problem:
#define MYDEFINE    1

/datum/foo
var/bar = "[MYDEFINE]"
var/baz = "[1]"


Expected Results:
Things to compile.
Actual Results:
__DEFINES\a.dm:4:error: =: expected a constant expression
__DEFINES\a.dm:5:error: =: expected a constant expression

Does the problem occur:
Every time? Or how often?
Every time.
In other games?
n/a
In other user accounts?
n/a
On other computers?
n/a

When does the problem NOT occur?
When there are no expressions embedded in the string.

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
didn't test

Workarounds:
Type out the constants directly. This isn't great, but it works.
If this isn't considered a bug, a move to Feature Requests would be great.
Bump
Using the embedded expression is what's doing it, not the thing inside of it.

#define TEST "test"

mob
var/test = TEST


Works fine.
Lummox JR resolved issue (Not Feasible)
The hope would be that the compiler could "evaluate constant expressions" involving constant strings.

"A["B"]" and "A" + "B" should compile to "AB", ideally.