Re: expression and statements in Java




"Shin" <bxin@xxxxxxx> wrote in message news:1122589401.219495.165140@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Would it be good to allow me to write either:

<cond> ? <code1> : <code2>

or

if(<cond>) then <code1> else <code2>

without forcing me to commit to which context this piece of code will
appear: i.e., expression or statement.


Normally you will choose one or the other, but when you generate code,
sometimes you just don't know.


Now I miss functional lang.

Suggestions? thanks,

Do what you want to do, who's stopping you?

.