From: "M. Edward (Ed) Borasky" Date: 2006-10-07T00:57:30+09:00 Subject: Re: [FEATURE REQUEST] C#'s ?? Operator Martin Coxall wrote: >> Do you mean making (a ?? b) as shorthand for (a.nil? ? a : b)? >> I'm not sure it is handy enough to add new operator (yet). >> > > I think the point he was trying to make was that (a ?? b) can be > written (a || b) in languages where nil/null==false. > > I think that's fine for duck typed languages, but it's not for > statically typed languages. > > if (null) {...} is a syntax error in Java and C#. Works in C++ though, > which kind of proves my point. > > Martin > > Speaking of which: 1. 'nil' and 'false' behave as false in Ruby; everything else behaves as true, 2. 'nil' and (something else whose name I've forgotten) behave as false in Lisp, everything else behaves as true, 3. Only '#f' behaves as false in Scheme, everything else, including 'nil', behaves as true, 4. The "R" dialect of the "S" language has a different behavior, as do other dialects of the "S" language, and the two dialects differ. **BAH** **BAH** !!