[slang-users] Re: slang 2.2.0 release candidate 1 available

Jörg Sommer joerg at alea.gnuu.de
Mon Jul 20 23:01:26 UTC 2009


Hello John,

"John E. Davis" <davis at space.mit.edu> 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?


More information about the slang-users-l mailing list