From: "David A. Black" Date: 2005-01-20T00:54:54+09:00 Subject: Re: value by reference Hi -- On Thu, 20 Jan 2005, Michel Martens wrote: > On Thu, 20 Jan 2005 00:19:13 +0900, David A. Black wrote: >> >> What would you replace 5 with? :-) >> >> (Remember, you're sending the 'replace' method to an *object*, not an >> identifier.) > > Hi, David. I know how it works now, that's why it's a proposal. The > idea would be to modify the language to allow that kind of > manipulation. Then, the following methods would be allowed: > > a = 'hello world' # String > a.replace(/\w+/) # Regexp > a.replace(35) # Fixnum > a.replace(SomeClass.new) # SomeClass > > And then you would be able to add methods like to_s! or to_i!, etcetera. I guess that's similar to the "become" idea that people have discussed at various times. I personally see it as a solution in search of a problem, but I know it's popular with the meta-meta-meta-3vi1 crowd :-) David -- David A. Black dblack@wobblini.net