From: Henning von Rosen Date: 2001-12-22T22:02:16+09:00 Subject: [ruby-talk:29307] Re: AdjectiveNoun class names (was: Re: Re: Why is UnboundMethod a subclass of alias_method) > I guess -- really just "thinking out loud" I like your thinking. Just if anyone is interested, here are some additional toughts on the theme: I have lately looked into understanding natural language from a programmming language design perspective, and vice versa. It is interesting; but be warned -- I havn't found the right vocabulary yet. The linguists say (see fx WordNet: 5papers p26... http://www.ac-toulouse.fr/wordnet/download.htm ) there are two basic kinds of adjectives; descriptive and relational. (and not so many that are reference-modifyers.) _descriptive_ adjectives can be used in the form "obj.adj?" or as modifyers, often in the implicit form of a combined attribute and attributevalue, added to a "functioncall/nounphrase" at parsetime. the attribute value can be a lazily instantiated class, that is a subclass of the attribute. oh, I forgot; attributes are ofte implemented as functions from identyties to other identyties (or thunks -- lazily instantiated classes). _realational_ adjectives has another role, often as a function from a superclass to it's subclass, immediately executed at parsetime. scince these perform an immediate mapping to a subclass, they can not be used alone for testing for properties. in this role, realtional adjectives spare the human brain for the need of making and remembering a new word, at the small cost of parsing efficyency. --- this is not to say that thre is no such thing as classes that differs form their superclass only by an attribute-definition, only they cannot normally be made from the adjective+ the noun, although in some cases in some languages this is is part of the morphology. (like in northern sweden.) also in swedish, the normal way of using realtional adjectives is to glue the noun stem of it directly onto the beginning og the main noun, unlike english. Esperanto, interestingly does allow both. these kind of "modularisation" and "glue" are not so often in programming languages, I think. If you think your answer to this letter is relevant for me, please cc me -- not always looking at ryby-talk. > not claiming great cogency > -- that in the case of ((Un)Bound)Methods, this would mean having > things like: > > if m.bound? ... ----- Original Message ----- From: "David Alan Black" To: "ruby-talk ML" Sent: Friday, December 21, 2001 10:14 PM Subject: [ruby-talk:29258] AdjectiveNoun class names (was: Re: Re: Why is UnboundMethod a subclass of alias_method) > Hi -- > > On Fri, 21 Dec 2001, Yukihiro Matsumoto wrote: > > > For your information, it's almost historical reason. I developed > > Method (BoundMethod) first, not knowing UnboundMethod was possible. > > > > If I was introducing both BoundMethod and UnbountMethod at the same > > time, it might be > > > > Method > > BoundMethod > > UnboundMethod > > > > or might be as you said > > > > UnboundMethod > > BoundMethod > > > > due to my less-class-ism. > > Picking up on something from #ruby-lang, which itself grew out of > this: namely, the question of class names that have adjectives and > nouns together. > > It came up on #ruby-lang when I made the comment that I don't like > them :-) Whenever I see such a name, I always feel like there's a > coupling that (ideally) shouldn't be there. The adjective part of the > name feels like it's expressing something which should be an > attribute, and/or should be in a module. > > I guess -- really just "thinking out loud", not claiming great cogency > -- that in the case of ((Un)Bound)Methods, this would mean having > things like: > > if m.bound? ... > > and such, which I know is very different but which feels better to me > because it puts the weight on the behavior of the object rather than > an adjective in the class name. > > I'm not (necessarily :-) lobbying for this to be rethought in this > particular case, especially since I'm not very knowledgeable about > this area. But out of general interest I'm curious whether other > people have this reaction to names like this. > > > David > > -- > David Alan Black > home: dblack@candle.superlink.net > work: blackdav@shu.edu > Web: http://pirate.shu.edu/~blackdav >