[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

The Old Switcharoo

Trans

8/30/2006 6:16:00 PM

I have a class that has a lot of data members. On top of that I have a
lot methods that I dynamically mixin to that class as needed, and they
of course use those data members. The thing is the methods and data
members are numerous enough and related in such a way that there is
some contention for namespace. Since I'm only calling on the methods as
needed it would be cool if I could acually mix one in, invoke it, and
then snatch it back out just before executation begins to let the data
member back in. In other words, I guess I want caller context sensitive
(cflow?) namespacing.

Interesting? Possible? Any clever ways to pull it off in pure Ruby?

Thanks,
T.

1 Answer

Its Me

8/30/2006 8:53:00 PM

0

Some versions of selector namespaces would effectively allow this, I
believe.

"Trans" <transfire@gmail.com> wrote in message
news:1156961770.689096.15930@m79g2000cwm.googlegroups.com...
>I have a class that has a lot of data members. On top of that I have a
> lot methods that I dynamically mixin to that class as needed, and they
> of course use those data members. The thing is the methods and data
> members are numerous enough and related in such a way that there is
> some contention for namespace. Since I'm only calling on the methods as
> needed it would be cool if I could acually mix one in, invoke it, and
> then snatch it back out just before executation begins to let the data
> member back in. In other words, I guess I want caller context sensitive
> (cflow?) namespacing.
>
> Interesting? Possible? Any clever ways to pull it off in pure Ruby?
>
> Thanks,
> T.
>