Path: utzoo!attcan!uunet!mcsun!ukc!dcl-cs!aber-cs!athene!pcg From: pcg@cs.aber.ac.uk (Piercarlo Grandi) Newsgroups: comp.object Subject: Re: The Emperor Strikes Back Message-ID: Date: 28 Feb 91 18:54:07 GMT References: <3351@sequent.cs.qmw.ac.uk> Sender: pcg@aber-cs.UUCP Organization: Coleg Prifysgol Cymru Lines: 31 Nntp-Posting-Host: odin In-reply-to: kers@hplb.hpl.hp.com's message of 22 Feb 91 08:39:52 GMT On 22 Feb 91 08:39:52 GMT, kers@hplb.hpl.hp.com (Chris Dollin) said: [ ... on whether objects are closures with an overload resolution procedure associated to them ... ] kers> [ ... ] I seem to recall that such a method is described in kers> Abelson and Sussman. It's nice that it can be done at all, but kers> it's not as nice as supporting the object orientation (whatever kers> that means ...) directly in the language. Actually, as I hopefully clearly show in other articles in this newsgroup, there is absolutely no difference; if your language, like most Schemes, has got macros, you never need to know that objects are indeed implemented as closures with an overload resolutor (I think Poplog has got the necessary facilities too). Also, if your compiler is clever this need not be less efficient than having OO as primitives, as the overload resolutor can be inlined and evaluated at compile time if its parameters (the name of the method, the types of its arguments) are statically known, as it happens fairly often, and using a closure as a record can be quite efficient too, and give wonderful ease of debugging. The Abelson & Sussman book actually shows this quite clearly; they also demonstrate that with a little bit of macro based sugaring one can have far more flexible facilities, includign visibility control, accessibility control, multiple implementations for the same interface and viceversa, than in most OO languages where closures and overload resolvers are hidden in the compiler or interpreter. -- Piercarlo Grandi | ARPA: pcg%uk.ac.aber.cs@nsfnet-relay.ac.uk Dept of CS, UCW Aberystwyth | UUCP: ...!mcsun!ukc!aber-cs!pcg Penglais, Aberystwyth SY23 3BZ, UK | INET: pcg@cs.aber.ac.uk