From: Jean-Hugues ROBERT Date: 2004-05-02T06:06:27+09:00 Subject: Re: Ruby Newbie (ooh, that rhymes!) - When do I use do/end, when {}? At 05:54 02/05/2004 +0900, you wrote: >I've read the User Guide and other docs on the net, but I'm a little >unsure as to whether I can ALWAYS substitute the DO/END with curly >brackets for a block? For example, I've only ever seen referenced to >hash definitions using curlies. What's the rule here? Is it purely >down to preference? Welcome. You can always substitute the DO/END with curly brackets for a block. However, in some cases, you may need some extra parenthesis. This is due to {} having a different precedence than do/end and correlated impact on associativity. And Yes, Ruby Rocks. Yours, Jean-Hugues ------------------------------------------------------------------------- Web: http://hdl.handle.net/1030.37/1.1 Phone: +33 (0) 4 92 27 74 17