Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!ames!think!barmar From: barmar@think.COM (Barry Margolin) Newsgroups: comp.lang.lisp Subject: Re: CLOS: is it OOP? Message-ID: <29625@news.Think.COM> Date: 18 Sep 89 21:45:53 GMT References: <19582@mimsy.UUCP> <29564@news.Think.COM> <11815@polya.Stanford.EDU> <29573@news.Think.COM> <1989Sep18.015805.9592@odi.com> Sender: news@Think.COM Distribution: usa Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 37 In article <1989Sep18.015805.9592@odi.com> dlw@odi.com writes: >In article <29573@news.Think.COM> barmar@think.COM (Barry Margolin) writes: > > Flavors and CLOS permit methods to access any of the object's > instance variables directly, even instance variables defined by a > sibling class. > >No, Flavors does not. (It has the feature called "gettable" in old >Flavors and "readable" in New Flavors that allows you to give >outsiders access to instance variables, but they are off by default.) I just wrote the following code on my Lispm and it worked fine. FOO and BAR are sibling flavors in FOOBAR, and FOO's methods can access BAR's instance variable A. (defflavor foo () () (:required-instance-variables a)) (defmethod (frob foo) () a) (defflavor bar (a) ()) (defmethod (set-a bar) (new-a) (setq a new-a)) (defflavor foobar () (foo bar)) (setq it (make-instance 'foobar)) (set-a it 3) (frob it) => 3 Barry Margolin Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar