ID:928488
 
Keywords: dm, funny, quirks
Welcome to the proverbial Twilight Zone of DM.

Compiles

Inner classes (Sort of), by DivineTraveller:
data_type
proc/do_a_thing()
/cake {
parent_type=/atom
var pie=2;
}

return new/cake();


Questionmarks ahoy! And a mob that is a list.
mob/proc/Test(?) {
var/mob/notAMob[3];
notAMob[1] = 0;
notAMob[2] = 1;
notAMob[3] = 0;
for(. = 1 to notAMob.len) {
? = notAMob[.];
world << "[? ? ? : ?]";
}
}


Zoidberg!
mob/proc/zoidberg(;;;;;;;;;) {
var/mob/?[3];
?[1] = 0;
?[2] = 1;
?[3] = 0;
world << "[?.name] hi";
}


The above actually doesn't crash, it just outputs nothing for ?.name.

Doesn't compile, but throws funny stuff at you

var/mob/bobby/hi[5];
hi[1] = 5;


Gives:
Template.dm:22:error: hi: undefined type: hi
Template.dm:21:warning: hi: variable defined but not used

Without assignment (hi[1] = 5), it compiles. Any reference to the variable, and DM blows up.

var/mob/hi[5];
hi[1] = 5;


Works fine.

Zoidberg returns!
/()

mob/proc/zoidberg(;/()) {
var/mob/?[3];
?[1] = 0;
?[2] = 1;
?[3] = 0;
world << "Ready to crash?";
world << "[?.name] hi";
world << "[().type]";
world << "Hm.";
}


Gives:
Template.dm:29:error: bad embedded expression [()]

It seems to compile anyway, and outputs "type]" on the world < "[().type]" line.

Post more quirks, if you can find them / know of any ;)
Secret support for inner types (yep, it compiles):
data_type
proc/do_a_thing()

/cake {
parent_type=/atom
var pie=2;
}

return new/cake();
In response to DivineTraveller
DivineTraveller wrote:
Secret support for inner types (yep, it compiles):

Yeah. Its too bad they're not actually inner classes, since there is no scope for these sorts of things.

So /cake is exposed to everything. It would be useful if /cake was hidden, or at least its constructor, allowing you to force Factory pattern.
Try throwing this into your project and watch your compiler freak out.
mob/parent_type = /turf


Or you could do this to crash it.
mob/parent_type = /turf

turf/parent_type = /mob

In response to Hiro the Dragon King
I froze it with this:
datum/parent_type=/atom