Newsgroups: comp.lang.dylan
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!gatech!howland.reston.ans.net!EU.net!news2.EUnet.fr!news.fnet.fr!ilog!news
From: davis@ilog.fr (Harley Davis)
Subject: Re: object methods with same
In-Reply-To: nkramer@cs.cmu.edu's message of 12 Apr 1995 18:36:30 GMT
Message-ID: <DAVIS.95Apr13103704@passy.ilog.fr>
Lines: 48
Sender: news@ilog.fr
Nntp-Posting-Host: passy
Organization: Ilog SA, Gentilly, France
References: <2880547881@hoult.actrix.gen.nz> <3mh212$qqv@netnews.upenn.edu>
	<3mh6je$7hj@cantaloupe.srv.cs.cmu.edu>
Date: 13 Apr 1995 08:37:03 GMT


In article <3mh6je$7hj@cantaloupe.srv.cs.cmu.edu> nkramer@cs.cmu.edu (Nick Kramer) writes:

   Remember that slots in Dylan are really just generic functions, and
   so are controlled via modules the same way anything else is.

Accessor function bindings are controlled by modules, but I don't
believe slot names are.  That they are usually homonymous is simply a
pun encouraged by the default accessor function naming scheme.  Can
you give a reference in the DIRM for your assertion?

   The following is invalid Dylan program:

	   module: dylan-user

	   define class A (<object>)
	     slot foo;
	   end class A;

	   define class B (A)
	     slot foo;
	   end class B;

   You get the slot clash error.  However, if you put the two classes in
   separate modules (and don't export foo from the first module), it
   works just fine:

I don't believe you.

   In this second (working) case, what you get is two *different*
   generic functions, both named "foo".  The first one exists only in
   the ptest-1 module, the second exists only in the ptest-2 module.
   Since B can't see A's foo slot, it's free to define its own.

Unless I've completely misunderstood things, you get two different
accessor functions, but there is still a slot name conflict.

-- Harley Davis

-- 

------------------------------------------------------------------------------
Harley Davis                            net: davis@ilog.fr
ILOG S.A.                               tel: +33 1 46 63 66 66
2 Avenue Gallini, BP 85                fax: +33 1 46 63 15 82
94253 Gentilly Cedex, France            url: http://www.ilog.com/

           Ilog Talk information: info@ilog.com
