[haXe] syntax sugar feature request: default operator
Sylvain Abélard
sylvain.abelard+haxe at gmail.com
Thu Aug 2 22:24:29 CEST 2007
Ruby does the following, which I also find really cool :
a ||= "test"
This operator "or-equal" does not conflict with any other operator
(provided your token and grammar rules are not completely stupid,
forgive me for not knowing ocamlyacc or whatever haXe is parsed with)
and seems quite logical.
> ?a = "franco";
> a = a ?? "franco";
Your first syntax looks quite weird to me (enough with those pointers
and reference stuff in C/C++ !). It's been a long time since I've been
messing with lexers/parsers but it doesn't seem quite straightforward
to implement to me. The second looks quite cool.
--
Sylvain Abelard,
Railer Rubyist. Epita MTI 2008.
More information about the Haxe
mailing list