Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ames!think!barmar From: barmar@think.COM (Barry Margolin) Newsgroups: comp.lang.lisp Subject: Re: CLOS: is it OOP? Message-ID: <29564@news.Think.COM> Date: 15 Sep 89 21:11:35 GMT References: <19582@mimsy.UUCP> Sender: news@Think.COM Distribution: usa Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 53 In article <19582@mimsy.UUCP> folta@tove.umd.edu.UUCP (Wayne Folta) writes: >"Because CLOS makes no effort at protection or encapsulation, some might >find that it lacks the most essential thing for an object-oriented system." There is as yet no general concensus on what is the "most essential thing for an object-oriented system". Find the proceedings of any recent OOPSLA conference and you'll almost certainly find a panel discussion about this very topic, and every panelist will have a different idea of what is important. Probably the only thing common to all object systems is some notion of inheritance. 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. It could also be the general Lisp philosophy of allowing the programmer as much freedom as possible. DLW, do you know why HIC implemented Flavors this way? >"Generic functions are a step away from the concept of active data and back >toward the conventional division between passive data and active process." 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 ...) Either one can readily be defined in terms of the other: Generic function in terms of application: (defun foo (object &rest args) (lexpr-send object 'foo args)) Application in terms of generic function: (defun send (object message &rest args) (apply message object args)) 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. Barry Margolin Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar