- Subject: [slang-users] Re: slang 2.2.0 release candidate 1 available
- From: Jörg Sommer <joerg@xxxxxxxxxxxx>
- Date: Mon, 20 Jul 2009 23:01:26 +0000 (UTC)
Hello John,
"John E. Davis" <davis@xxxxxxxxxxxxx> wrote:
> Interpreter Enhancements
> ========================
It's greate to hear S‐Lang gets these enhancements. I very welcome them.
>
> 1. The ternary expression was added:
>
> expression = condition ? val1 : val2
>
> If condition is non-zero, then expression = val1,
> otherwise expression = val2
Can you extend this expression to evaluate to condition if val1 isn't
present? I find it very helpful to write
exp = container.get(10) ? : default_object
instead of
exp = container.get(10) != NULL ? container.get(10) : default_object
Bye, Jörg.
--
Was ist das bloß für eine Welt, in der es mehr Mut braucht ehrlich zu
weinen als Stärke vorzutäuschen?
[2009 date index]
[2009 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]