From: "David A. Black" Date: 2005-02-14T09:11:34+09:00 Subject: Re: mandatory braces Hi -- On Mon, 14 Feb 2005, Joao Pedrosa wrote: > I think that one of the things that make Ruby what it is is the > general flexibility of its syntax. The other day I saw this in an > example for Rails: > > {= foo.flash['bar'] if foo.flash['bar'] } > > or Something... See? The flexibility paid off for the guy that wanted > to use it like that. Isn't the idea there to produce a string value if there is one returned by foo.flash['bar'], but not otherwise? If so, and unless there's some weird default thing going on, it could be written with just one foo.flash['bar'] -- which will return nil if not defined, which is exactly what the unsuccessful 'if' clause will return, and that nil (either way) will be represented as an empty string. So while you can use the 'if', there's no gain from doing so in this case. (Assuming I'm interpreting the intention correctly, of course.) David -- David A. Black dblack@wobblini.net