ID:160775
 
Applicable Configuration:Dream Maker?
BYOND Version:4.22
Operating System:Windows XP
Web Browser:Firefox/Netscape
Descriptive Problem Summary:
error: expected ':'
Numbered Steps to Reproduce Problem:
use a ? using only defined [things]
Code Snippet (if applicable) to Reproduce Problem:
layer=hiding?TURF_LAYER:MOB_LAYER


Expected Results:
to compile
Actual Results:
error: expected ':'
Does the problem occur:
Every time? Or how often?Everytime
In other games?I don't see why not
On other computers?Yep
In other user accounts?Yep

When does the problem NOT occur?When you get rid of the definitions

Workarounds:
sience its a definition you can just use the difined value like turf_layer=2 mob_layer=4.

**Edit**
on future inspection it happens not to be all defines
nor is it defines with underscores..
Just the built in definitions don't work
the dirs[SOUTH,NORTH]
the steps[NO_STEPS]
the layers[MOB_LAYER]
all of those don't work
Space them out:
layer=hiding ? TURF_LAYER : MOB_LAYER
In response to DarkCampainger (#1)
Why do i have to space them out though? you and I have differnt coding prefernences and my ocd can't handle spaced out code. It has to be as non-white-space as possible.
In response to Tubutas (#2)
You have to space them out so that the compiler can pick them up as separate tokens rather than one. If you have it all as one single 'word', the compiler thinks 'ah, they mean the : operator, not the ?/: pair' and all sorts of errors appear. Granted, it would be nice if it recognised that you meant the : of a :/? pair, but then what does it do when you have multiple colons? Consider this 'poorly written' piece of code:
a_variable? player:loc:name:loc:name

It's not exactly a practical example, but anyway. Where does the compiler draw the line there? Any one of those colons could be the ?/: colon. Spacing it out removes ambiguity altogether and means you don't get wierd runtime (or even compile time errors) because the compiler knows which variables go where.
In response to Hazman (#3)
If he's hellbent on not spacing them out, he can put parantheses around each one.