Vincent Fourmond
9/27/2006 9:32:00 PM
Robert Dober wrote:
> On 9/27/06, gwtmp01@mac.com <gwtmp01@mac.com> wrote:
>>
>>
>> <SNIP>
>>
>> Another example might be the array of bytes that is associated with
>> an instance
>> of String. Strings are first class objects but the data associated
>> with a string
>> is not.
>
>
> ty Gary you make my point, when we talk about strings, methods objects we
> talk about the interfaces Ruby gives us to them, everything else is out of
> context, implementation if you want.
>
> IOW there is no string or method in Ruby, there is only String, Method,
> UnboundMethod etc, etc.
> we use the words string method to explain concepts to human beings, Ruby is
> not a human being (yet ;).
However, there is quite a difference between String/string and
Method/method : for String, you can only access the string via the
String class. For the methods, you fortunately don't need the Method
class to execute methods...
The Method class is just a thin facility (too thin, IMHO) provided for
simple methods manipulations, whereas String is a full-blown string
manipulation library.
But if you want to copy methods from one place to the other, try
programming some C extensions to do that ;-)...
Cheers !
Vince