[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: Confusion Over Keyword Arguments

Berger, Daniel

3/2/2006 4:11:00 PM

> -----Original Message-----
> From: Jay Levitt [mailto:jay+news@jay.fm]
> Sent: Wednesday, March 01, 2006 6:14 PM
> To: ruby-talk ML
> Subject: Re: Confusion Over Keyword Arguments
>
>
> On Thu, 2 Mar 2006 08:46:23 +0900, Yukihiro Matsumoto wrote:
>
> > No, we don't have to. The colon can be ugly with symbols, for
> > example,
> >
> > db.find(order: :date)
> >
> > is not good looking. Any other proposal (except for "=')?
>
> If the keyword has to be unadorned, and this has to be done
> solely through an infix operator, how about:
>
> db.find (order ~> :date)
> db.find (order -> :date)
>
> If it's ok to adorn the keyword, and the parser can
> distinguish these, that opens up lots of options:
>
> db.find ([order] = :date)
> db.find (|order| = :date)
> db.find (-order- = :date)
> db.find (/order/ = :date)
> db.find (#order# = :date)
> db.find (#order = :date)
>
> I've got no clue how the parser works, so these may be
> non-starters for various reasons.
>
> Jay Levitt

Or, maybe we should just stick with "=>" as a keyword operator, and
declare that if you want to pass a literal hash, you have to wrap it in
{}.

Regards,

Dan