ID:1860630
 
Not a bug
BYOND Version:507
Operating System:Windows 7 Pro
Web Browser:Firefox 38.0
Applies to:Dream Maker
Status: Not a bug

This is not a bug. It may be an incorrect use of syntax or a limitation in the software. For further discussion on the matter, please consult the BYOND forums.
When first defining a string variable in an object you cannot use a preprocessor define without getting a compile error.

#define BOOP "this is the other half of our string"
#define BEEP "This is an entire string"
#define BEEPBOOP "What?"
/obj/Thing
var/stringstring = "This is the first half of our string and [BOOP]"
var/stringstring2 = BEEP
var/stringstring3 = "[BEEPBOOP]"

New(loc)
stringstring = "[BEEP] [BOOP] [BEEPBOOP]"


This results in 2 compile errors

test.dm:5:error: =: expected a constant expression
test.dm:7:error: =: expected a constant expression

Note that using the preprocessor defines in New() works fine, as well as using just the define, but when using it within a string it gives that error only in the initial definition of the variable.
It seems to work if you use + instead of [].
#define a "a"
#define b "b"
var const/c = a + b
Lummox JR resolved issue (Not a bug)
Whenever you use the [] notation in a string, even if the item in the brackets is constant, the string is considered non-constant. I would consider a change to that behavior to be more of a feature request. However, I don't know how doable this sort of thing really is at compile-time.

The + operator on the other hand can be used on constant strings to create a new constant string.