[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

RCR 307: allow attributes to take arguments for assignment

Eric Mahurin

5/15/2005 7:01:00 PM

I just put in a RCR that allows for a little more syntax sugar.
The proposal is just to make:

object.attribute(arguments) = expression

to be equivalent to:

object.send(:attribute=,arguments,expression)

This would just be a nice-to-have RCR in my opinion as you can
use standard methods instead. But, it does seem like Rubyish
syntax. Here is the link if you are interested:

http://www.rcrchive.net/rc...




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


2 Answers

ES

5/15/2005 7:21:00 PM

0


Le 15/5/2005, "Eric Mahurin" <eric_mahurin@yahoo.com> a écrit:
>I just put in a RCR that allows for a little more syntax sugar.
> The proposal is just to make:
>
> object.attribute(arguments) = expression
>
>to be equivalent to:
>
> object.send(:attribute=,arguments,expression)
>
>This would just be a nice-to-have RCR in my opinion as you can
>use standard methods instead. But, it does seem like Rubyish
>syntax. Here is the link if you are interested:
>
>http://www.rcrchive.net/rc...

Call me stupid, but I am afraid I do not understand what this
code would *do*. Could you clarify, maybe post an example (if
possible, with Ruby code)?

E

--
template<typename duck>
void quack(duck& d) { d.quack(); }


nobu.nokada

5/15/2005 11:42:00 PM

0

Hi,

At Mon, 16 May 2005 04:00:48 +0900,
Eric Mahurin wrote in [ruby-talk:142729]:
> I just put in a RCR that allows for a little more syntax sugar.
> The proposal is just to make:
>
> object.attribute(arguments) = expression
>
> to be equivalent to:
>
> object.send(:attribute=,arguments,expression)

I'd tried it once and found it was so tough to let yacc swallow
it. But will try again later.

--
Nobu Nakada