On 4-Jan-07, at 7:40 AM, Eduardo Cavazos wrote: > Slava, > > Say you have classes person and airplane. You also want a method > called move > that works on person and airplane objects. Which vocabulary should > GENERIC: > be in? person or airplane? If you choose person, then airplane will > have to > use person in order to put move into the generic. But what if > person and > airplane don't have much to do with each other and won't > necessarily be used > in the same program? Then should the GENERIC: go into some third > file/vocab > that specifies a protocol that move is a part of?
You could also define a move word in the person vocabulary, and a move word in the airplane vocabulary. > I think methods with the same generic should be able to be defined > across > classes that have nothing to do with each other. I hope that the > Factor > object system was designed to allow for this. In Common Lisp this > doesn't > appear to be the case. Methods must be "congruent"; all have the > same arity. > This really sucks because a method defined on oranges may be really > different > from a method defined on apples and they shouldn't have to be > "congruent". > Other languages like Gauche and RScheme fix this. Goo didn't. If you want to define methods on oranges and apples which are not congruent, then define two different words. Slava ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Factor-talk mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/factor-talk
