From: Richard Kilmer Date: 2004-06-09T03:32:42+09:00 Subject: Re: Expressing intent in method calling... On 6/8/04 11:51 AM, "Dave Thomas" wrote: > > On Jun 8, 2004, at 9:43, Richard Kilmer wrote: > >> This is not a continuation of the type thread other than trying to >> continue >> to discuss the ideas of adding metadata that could be used to help the >> runtime environment of Ruby. Before anyone says anything, I have >> built lots >> of Ruby code without this, and the runtime is just fine...think of >> this as >> exploration. Disregard all the other syntax I wrote on earlier...and I >> do >> not care whether something is Hash-like, or is_a? Duck ;-) >> >> class Person >> attr_accessor :name >> end >> >> def greet(person) >> puts "Hello there #{person.name}" >> end > > Isn't this effectively "to_name" or "as_name"? > I am not trying to coerce the object into another representation in general (although in the specific example its like that). Generally, I am trying to add to the message something more than the message symbol and parameters...I am trying to add the 'meaning' of the message as scoped in the namespace of the provided class/module. I am trying to add to the method additional semantics of what I am asking from the target object. I am sending the message 'name' with the meaning that 'name' has on a Person object. That receiver may or may not care...answering the way it wants, but right now I cannot express that semantics at all. I guess I am not expressing myself with sufficient semantics ;-) -rich