{} vs begin/end [was Re: object loops and what they return]

Oops, # is a comment ...

Need more coffee :wink:

路路路

-----Original Message-----
From: Neville Burnell [mailto:Neville.Burnell@bmsoft.com.au]
Sent: Friday, 13 May 2005 10:22 AM
To: ruby-talk ML
Subject: Re: {} vs begin/end [was Re: object loops and what they return]

["pet": "dog", "name": "fred", "drink": "ale"]

I'm a newbie, but how about the obvious:

["pet" # "dog", "name" # "fred", "drink" # "ale"]

-----Original Message-----
From: Eric Mahurin [mailto:eric_mahurin@yahoo.com]
Sent: Friday, 13 May 2005 4:29 AM
To: ruby-talk ML
Subject: Re: {} vs begin/end [was Re: object loops and what they return]

--- Ben Giddings <bg-rubytalk@infofiend.com> wrote:

On Thursday 12 May 2005 13:38, David A. Black wrote:
> You'll have to fight it out with the ones who wanted braces
for block
> literals and hashes to be something else :slight_smile:

I could accept that too -- I would just want one syntax for blocks, a
different one for braces, and no confusing middle ground.

I'd be happy with this for arrays too:

["pet" => "dog", "name" => "fred", "drink" => "ale"]

or

["pet": "dog", "name": "fred", "drink": "ale"]

I just think that {a => b} and {a <= b} are too similar.

I agree. But, I prefer the braces for code (code is more fundamental
than hashes and deserves {}). I think this current syntax looks good to
me:

Hash["a" => 100, "b" => 200]

__________________________________
Yahoo! Mail Mobile
Take Yahoo! Mail with you! Check email on your mobile phone.
http://mobile.yahoo.com/learn/mail