From: Kevin Olemoh Date: 2006-10-07T11:43:53+09:00 Subject: Re: What is the reason for this syntax? What you say is valid and gets right to what I am really trying to get at with respect to the blocks the syntax rule is a bit too strict is all. You have pointed out the distinction better than I was able to that is for sure. On 10/6/06, MonkeeSage wrote: > > Coding conventions (like where you place your braces in C) are > completely different from language syntax rules (like where parameters > to functions and blocks must be). You can code however you like *within > the bounds of the language syntax*. In C you can't write this, no > matter how much you like it: > > printf "%s", "Hi" ! > > The C syntax requires parens for function invocation, and requires a > line to be terminated by a semi-colon, not an exclaimation mark. So by > all means, write your ruby code however you like it, but don't confuse > issues of coding convention with issues of syntaxis. > > Coding convention: > > if (blah.nil?) <- parens > > if blah.nil? <- none > > > Syntax: > > blah { block stuff } <- correct > > blah < block stuff > <- invalid > > blah > { <- invalid (well, valid syntax, but taken as hash literal not method > block to #blah) > } > > Regards, > Jordan > > >