[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

alias comma

Trans

9/8/2006 11:47:00 PM

Too small I think to post an actual RCR.

alias :this, :that
=> parse error, unexpected ','

Can we get alias to handle a comma, please.

T.


4 Answers

Logan Capaldo

9/8/2006 11:58:00 PM

0


On Sep 8, 2006, at 7:47 PM, Trans wrote:

> Too small I think to post an actual RCR.
>
> alias :this, :that
> => parse error, unexpected ','
>
> Can we get alias to handle a comma, please.
>
> T.
>
>

Use alias_method ?

I like the lack of the comma (and the need for :). Makes it clear
that it's syntax.

alias this that


Trans

9/9/2006 12:14:00 AM

0


Logan Capaldo wrote:
> On Sep 8, 2006, at 7:47 PM, Trans wrote:
>
> > Too small I think to post an actual RCR.
> >
> > alias :this, :that
> > => parse error, unexpected ','
> >
> > Can we get alias to handle a comma, please.
> >
> > T.
> >
> >
>
> Use alias_method ?
>
> I like the lack of the comma (and the need for :). Makes it clear
> that it's syntax.
>
> alias this that

That's fine. I don't care if also works without the comma. But it's
pointless that it can't handle both. Then there's no need for what's
"clear" or not, it just works.

T.

Paul Lutus

9/9/2006 2:45:00 AM

0

Trans wrote:

/ ...

>> I like the lack of the comma (and the need for :). Makes it clear
>> that it's syntax.
>>
>> alias this that
>
> That's fine. I don't care if also works without the comma. But it's
> pointless that it can't handle both. Then there's no need for what's
> "clear" or not, it just works.

If a comma were to be accepted in this case, someone would expect a list of
indeterminate length to be syntactically correct (because that is how
commas tend to be used). Then we would hear from those bitten by that
"bug".

--
Paul Lutus
http://www.ara...

Trans

9/9/2006 4:48:00 AM

0


Paul Lutus wrote:
> Trans wrote:
>
> / ...
>
> >> I like the lack of the comma (and the need for :). Makes it clear
> >> that it's syntax.
> >>
> >> alias this that
> >
> > That's fine. I don't care if also works without the comma. But it's
> > pointless that it can't handle both. Then there's no need for what's
> > "clear" or not, it just works.
>
> If a comma were to be accepted in this case, someone would expect a list of
> indeterminate length to be syntactically correct (because that is how
> commas tend to be used). Then we would hear from those bitten by that
> "bug".

Why would anyone expect that? It requires two arguments. I also point
out that it takes symbols just as well as literal names. Is anyone
becoming confused b/c it doesn't take a variable?

T.