Newsgroups: comp.lang.dylan
Path: cantaloupe.srv.cs.cmu.edu!europa.chnt.gtegsc.com!news.sprintlink.net!noc.netcom.net!netcom.com!netcom8.netcom.com!haahr
From: haahr@netcom.com (Paul Haahr)
Subject: Re: Default Generic Function Signatures
In-Reply-To: Bruce@hoult.actrix.gen.nz's message of Wed, 28 Jun 1995 11:31:26 +1200 (NZDT)
To: Bruce@hoult.actrix.gen.nz (Bruce Hoult)
Message-ID: <HAAHR.95Jun28113042@netcom8.netcom.com>
Sender: haahr@netcom8.netcom.com
Cc: Don Erway <derway@alumni.caltech.edu>
Organization: NETCOM On-line services
References: <DERWAY.95Jun27095857@alumni.ndc.com> <2887183886@hoult.actrix.gen.nz>
Date: Wed, 28 Jun 1995 10:30:42 GMT
Lines: 38

Bruce Hoult <Bruce@hoult.actrix.gen.nz> wrote:

> derway@ndc.com (D. Erway) writes:
> > I can't see anywhere in the DIRM, or design notes, what generic
> > function gets defined by default as I define methods.
> >
> > If I:
> >   define method foo(a :: <integer>)
> >    ...
> >   end;
> > what is the GF?  Is it just foo(<integer>)?
> 
> Yes.

No.  It's foo(<object>).

> > Now, if I add:
> >   define method foo(a :: <float>)
> >    ...
> >   end;
> > Do I get an expanded GF?  Like foo(<real>) or some such?
> 
> No, you'll get an error.

No.  It works just fine.

> > How does this work?
> 
> The first version defined is implicitly the most general you'll ever be
> able to define.  If this doesn't suit, you can use define generic to 
> declare the GF before first adding a method to it.

No.  Implicit definition of a generic function gives it the least
restrictive parameter list congruent with the method.

This was not specified in the DIRM, but has been clarified since then.

Paul
