There's been a discussion of allowing suffix if like in Ruby. Not enough people 
like it for it to have any traction.

 -- John

On Mar 19, 2014, at 8:33 AM, Cristóvão Duarte Sousa <[email protected]> wrote:

> Hi,
> 
> Sometimes I see myself writing one line if-elses like `if x<0 x=-x end`, 
> which I think is not very "readable".
> 
> What is your advice for that?
> "That is ok", "always put a semicolon after the condition" or "totally avoid 
> one liners"?
> 
> BTW, have you Julia devs ever considered introducing a "then" keyword which 
> could optionally be placed after the condition (à la Ruby)?
> `if x<0 then x=-x end` seems much more readable.
> 
> (I know the ternary operator, but I'm considering cases where no "else" 
> action exists.)
> 

Reply via email to