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

**URL:** <https://rubytalk.org/t/vs-begin-end-was-re-object-loops-and-what-they-return/18367>\
**Category:** ruby-talk\
**Created:** [13 May 2005 00:22 UTC](https://rubytalk.org/t/vs-begin-end-was-re-object-loops-and-what-they-return/18367 "2005-05-13T00:22:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neville\_Burnell1](https://avatars.discourse-cdn.com/v4/letter/n/85f322/32.png) [@Neville\_Burnell1](https://rubytalk.org/u/Neville_Burnell1)\
**Post date:** [13 May 2005 00:22 UTC](https://rubytalk.org/t/vs-begin-end-was-re-object-loops-and-what-they-return/18367/1 "2005-05-13T00:22:10Z")

</div>

> ["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 🙂
> > 
> > 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](http://mobile.yahoo.com/learn/mail)
