[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: general question about function parameters and spaces

Sebastian Hungerecker

5/22/2007 6:47:00 PM

Mike Steiner wrote:
> Why does Ruby frown upon putting spaces between a function name and the
> left parenthesis of its argument lists?

Because parentheses are optional around function parameters and can also be
used for precedence. Ruby uses the space before the parenthesis to tell
whether they are used for the former or the latter. Example:

fun 1+3*5 == fun(1+3*5)
fun (1+3)*5 == fun((1+3)*5) != fun(1+3) * 5

HTH
--
Ist so, weil ist so
Bleibt so, weil war so