Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!csd4.csd.uwm.edu!bionet!agate!shelby!polya!Neon.Stanford.EDU!pallas From: pallas@Neon.Stanford.EDU (Joe Pallas) Newsgroups: comp.lang.lisp Subject: Re: CLOS: is it OOP? Message-ID: <11815@polya.Stanford.EDU> Date: 15 Sep 89 23:47:47 GMT References: <19582@mimsy.UUCP> <29564@news.Think.COM> Sender: USENET News System Distribution: usa Lines: 41 In article <29564@news.Think.COM> barmar@think.COM (Barry Margolin) writes: >I'm also a fan of encapsulation and protection, but I don't think that >they are absolutely required for an object system. CLOS probably >lacks them mostly because Flavors lacks them, and Flavors probably was >copying DEFSTRUCT-style inheritance. and >The distinction between generic functions and active data is mostly >syntactic. Can you really see any semantic difference between > (send object 'foo ...) >and > (foo object ...) I'm inclined to agree that protection is not absolutely required for an object-oriented language (although I wouldn't want to use one without it). But I would argue that it is precisely because of generic functions that CLOS CANNOT have protection. To have protection, you must have a clearly defined protection boundary. Method invocations establish such a boundary, but generic functions do not. >The major benefit of generic functions is that it is like the rest of >Lisp. You can pass them around wherever ordinary functions are >permitted. For instance, they can be passed to mapping functions. In >a message-sending system, programs that accept messages generally >don't accept functions and vice-versa; you end up writing > #'(lambda (x) (send x 'foo)) >alot. I can't say for sure, but I don't think this is true unless you spend a lot of time writing named helper functions in CommonLisp. I just scanned through my Smalltalk sources and couldn't find any such trivial lambda expressions (blocks, in Smalltalk parlance). You almost always want to do more than just send a simple message in such a case. So you either have to write a special purpose method/generic function, or you use a lambda expression anyway. joe