Re: with-slots usage question
Miles Egan <[email protected]> Tue, 11 Nov 2003 09:16:24 -0800
| Newsgroups | gmane.lisp.clump |
|---|---|
| Message-ID | <1068570983.3150.3.camel@car> |
On Tue, 2003-11-11 at 09:01, Daniel Barlow wrote: > > I guess the ideal thing here from the programmer's point of view would > > be a language in which all functions are generic and the implementation > > is smart enough to optimize the ones that are never used > > polymorphically. > > Not really. The methods of a GF must have congruent lambda lists - > though it's pretty likely that your LENGTH method takes a single > argument and therefore doesn't conflict with the builtin (LENGTH > SEQUENCE), you still run into drouble when you want to define (OPEN DOOR) Good point. > I believe that the style to aim for, if you're going to get hung up on > style, is that a generic function does conceptually the same thing > whatever objects you call it on, but may do it in different ways for > different objects. So, it's OK to have an AREA gf that works on > polygons, but extending it to work on secret military bases (it > returns `51' for bases in the Nevada desert) is wrong, because that's > not the same thing. That's what I have been doing, and it's overall a pretty workable solution. I guess I may just have to bite the bullet and use with-accessors. > (Is the height of a triangle "the same thing" as the height of a > rectangle? The latter is the length of one of its sides, which > doesn't necessarily hold for the former. Depends on the application. > Discuss. All the time I save when programming from Lisp's interactive > development style and prototyping, I lose again agonising over this > stuff I wouldn't have time to worry about if I just used Java) Heh. I've always found it funny that OO advocates like to claim that OO is a very natural and intuitive model for the real world but that you don't have to go any farther than the concept of length to realize that's it's not really obvious at all. Of course, even this is nothing compared to the chaos that ensues when you start trying to fit objects into subject verb object kinds of patterns. Who acts on whom again? Looking forward to trying the new Araneida this weekend... -- Miles Egan <[email protected]> _______________________________________________ Clump mailing list [email protected] http://manly.caddr.com/mailman/listinfo/clump
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQA/sRlmU4Jq/wH1PVERAmp/AKDgwJxRhNDw6O6PeXUv8AV5bDgeoQCg65w6 R7CJCTyzIq98MU12mDj7ZGE= =9Dms -----END PGP SIGNATURE-----