ID:2393451
 
BYOND Version:512.1446
Operating System:Windows 10 Enterprise 64-bit
Web Browser:Firefox 61.0
Applies to:Dream Seeker
Status: Open

Issue hasn't been assigned a status value.
Descriptive Problem Summary:

Numbered Steps to Reproduce Problem:

Code Snippet (if applicable) to Reproduce Problem:
/mob/var/list/gender_list = list(MALE = "Male")

/mob/verb/test()
world << "gender: [gender], gender list key: [gender_list[gender]]"


Expected Results:
gender: male, gender list key: Male

Actual Results:
gender: male, gender list key:

Does the problem occur:
The problem occurs everytime.

When does the problem NOT occur?
When using "male" instead of MALE.

Workarounds:
Use the string version ("male") instead of the constant (MALE).
This isn't a bug, it's just how "quoteless" list associations work. Example:
// These are the exact same list
var/list/lst = list("player" = "James Byond", "score" = 2000)
var/list/lst = list(player = "James Byond", score = 2000)
It just happens that this syntax has priority over the names being variables.

This can be resolved by adding the gender constants (which are global constants) as #define macros:
#define NEUTER "neuter"
#define MALE "male"
#define FEMALE "female"
#define PLURAL "plural"

Since macros are replaced before compilation, it's as if you used the text literals in the first place.
Also this will be moot in 512.1447, because the #defines will be used there.