Sorry, but that last bit feels more like syntactic dung than syntatic sugar...
/ Leif Stensson, Lysator
Previous text:
2003-01-23 17:42: Subject: Re: zero_type() & UNDEFINED and _typeof()
I think the exception thing would work if there was some syntax sugar and a decent exception hierarchy.
try { mixed x = foo(); werror("The value is %O\n", x); } except { no_value: werror("No value\n"); }
One would also want some syntax sugar to make m[foo] | "bar" work (and do the right thing, with "bar" used iff m[foo] doesn't exist). It's hard to cook up a good syntax. Perhaps a trinary or n-ary !: could work (by a stretch analogy with trinary ?):
m[foo] ! no_value : "bar"
/ Niels Möller ()