From: Marco Antoniotti
Subject: NO-APPLICABLE-METHOD usage.
Date: 
Message-ID: <y6c1yeqzrrk.fsf@octagon.mrl.nyu.edu>
Hi

I have the following code.

    (defgeneric foo (x y z))

    (defmethod no-applicable-method ((x (eql #'foo)) &rest args)
      (error 'my-special-error-here))

Given the definition of NO-APPLICABLE-METHOD in the CLHS, is the above
a legal use of it?

Thanks

-- 
Marco Antoniotti ========================================================
NYU Courant Bioinformatics Group        tel. +1 - 212 - 998 3488
719 Broadway 12th Floor                 fax  +1 - 212 - 995 4122
New York, NY 10003, USA                 http://bioinformatics.cat.nyu.edu
                    "Hello New York! We'll do what we can!"
                           Bill Murray in `Ghostbusters'.

From: Pekka P. Pirinen
Subject: Re: NO-APPLICABLE-METHOD usage.
Date: 
Message-ID: <uzo19r9cd.fsf@globalgraphics.com>
Marco Antoniotti <·······@cs.nyu.edu> writes:
> Given the definition of NO-APPLICABLE-METHOD in the CLHS, is the above
> a legal use of it?

Yes.  (It would probably be possible to give a more informative reply,
if you shared your doubts about it.)
-- 
Pekka P. Pirinen
"My definition of a free society is a society where it is safe
to be unpopular."
  - Adlai Stevenson (Wouldn't he be disappointed now!)
From: Martin Simmons
Subject: Re: NO-APPLICABLE-METHOD usage.
Date: 
Message-ID: <3c9753aa$0$225$ed9e5944@reading.news.pipex.net>
"Pekka P. Pirinen" <···············@globalgraphics.com> wrote in message
··················@globalgraphics.com...
> Marco Antoniotti <·······@cs.nyu.edu> writes:
> > Given the definition of NO-APPLICABLE-METHOD in the CLHS, is the above
> > a legal use of it?
>
> Yes.  (It would probably be possible to give a more informative reply,
> if you shared your doubts about it.)

The contentious issue is point 19 of 11.1.2.1.2 in the ANSI spec, which prevents
a conforming program from "Defining a method for a standardized generic function
which is applicable when all of the arguments are direct instances of
standardized classes."  Unfortunately, this seems to encompass the case of EQL
with an instance of a standardized class (STANDARD-GENERIC-FUNCTION in this
case).  A workaround is to define a subclass of STANDARD-GENERIC-FUNCTION and
use the :GENERIC-FUNCTION-CLASS option to DEFGENERIC when defining FOO.
--
Martin Simmons, Xanalys Software Tools
······@xanalys.com
rot13 to reply
From: Marco Antoniotti
Subject: Are CMUCL and ACL wrong? (Re: NO-APPLICABLE-METHOD usage.)
Date: 
Message-ID: <y6cy9gjyl90.fsf@octagon.mrl.nyu.edu>
Marco Antoniotti <·······@cs.nyu.edu> writes:

> Hi
> 
> I have the following code.
> 
>     (defgeneric foo (x y z))
> 
>     (defmethod no-applicable-method ((x (eql #'foo)) &rest args)
>       (error 'my-special-error-here))
> 
> Given the definition of NO-APPLICABLE-METHOD in the CLHS, is the above
> a legal use of it?
> 

Ok.  Nobody responded to this post.  But the kind folks at Lispworks
pointed out that LW (which forbids the above) may be right (cfr.
point 19 of 11.1.2.1.2), while CMUCL and ACL accept it.

Any comments?

Cheers

-- 
Marco Antoniotti ========================================================
NYU Courant Bioinformatics Group        tel. +1 - 212 - 998 3488
719 Broadway 12th Floor                 fax  +1 - 212 - 995 4122
New York, NY 10003, USA                 http://bioinformatics.cat.nyu.edu
                    "Hello New York! We'll do what we can!"
                           Bill Murray in `Ghostbusters'.
From: Duane Rettig
Subject: Re: Are CMUCL and ACL wrong? (Re: NO-APPLICABLE-METHOD usage.)
Date: 
Message-ID: <4663n4qkh.fsf@beta.franz.com>
Marco Antoniotti <·······@cs.nyu.edu> writes:

> Marco Antoniotti <·······@cs.nyu.edu> writes:
> 
> > Hi
> > 
> > I have the following code.
> > 
> >     (defgeneric foo (x y z))
> > 
> >     (defmethod no-applicable-method ((x (eql #'foo)) &rest args)
> >       (error 'my-special-error-here))
> > 
> > Given the definition of NO-APPLICABLE-METHOD in the CLHS, is the above
> > a legal use of it?
> > 
> 
> Ok.  Nobody responded to this post.  But the kind folks at Lispworks
> pointed out that LW (which forbids the above) may be right (cfr.
> point 19 of 11.1.2.1.2), while CMUCL and ACL accept it.
> 
> Any comments?

I don't understand the problem.  Point 19 comes under the control of the
first paragraph, which says "Except where explicitly allowed ..."

And in the definition of no-applicable-method, The second sentence of the
second sentence in the Descriptions section says "Programmers may write
methods for it".

-- 
Duane Rettig          Franz Inc.            http://www.franz.com/ (www)
1995 University Ave Suite 275  Berkeley, CA 94704
Phone: (510) 548-3600; FAX: (510) 548-8253   ·····@Franz.COM (internet)
From: Duane Rettig
Subject: Re: Are CMUCL and ACL wrong? (Re: NO-APPLICABLE-METHOD usage.)
Date: 
Message-ID: <41yeb4qfe.fsf@beta.franz.com>
Duane Rettig <·····@franz.com> writes:

> And in the definition of no-applicable-method, The second sentence of the
> second sentence in the Descriptions section says "Programmers may write
=========^^^^^^^^
> methods for it".

Sorry, it's late.  I meant "paragraph", here.

-- 
Duane Rettig          Franz Inc.            http://www.franz.com/ (www)
1995 University Ave Suite 275  Berkeley, CA 94704
Phone: (510) 548-3600; FAX: (510) 548-8253   ·····@Franz.COM (internet)
From: Marco Antoniotti
Subject: Re: Are CMUCL and ACL wrong? (Re: NO-APPLICABLE-METHOD usage.)
Date: 
Message-ID: <y6clmcgej36.fsf@octagon.mrl.nyu.edu>
Duane Rettig <·····@franz.com> writes:

> Marco Antoniotti <·······@cs.nyu.edu> writes:
> 
> > Marco Antoniotti <·······@cs.nyu.edu> writes:
> > 
> > > Hi
> > > 
> > > I have the following code.
> > > 
> > >     (defgeneric foo (x y z))
> > > 
> > >     (defmethod no-applicable-method ((x (eql #'foo)) &rest args)
> > >       (error 'my-special-error-here))
> > > 
> > > Given the definition of NO-APPLICABLE-METHOD in the CLHS, is the above
> > > a legal use of it?
> > > 
> > 
> > Ok.  Nobody responded to this post.  But the kind folks at Lispworks
> > pointed out that LW (which forbids the above) may be right (cfr.
> > point 19 of 11.1.2.1.2), while CMUCL and ACL accept it.
> > 
> > Any comments?
> 
> I don't understand the problem.  Point 19 comes under the control of the
> first paragraph, which says "Except where explicitly allowed ..."
> 
> And in the definition of no-applicable-method, The second sentence of the
> second sentence in the Descriptions section says "Programmers may write
> methods for it".

Thanks.  I believe you.  You caught the LW folks off guard :)

    (defmethod no-applicable-method ((x (eql #'foo)) &rest args) ...)

Should be allowed.

Cheers

-- 
Marco Antoniotti ========================================================
NYU Courant Bioinformatics Group        tel. +1 - 212 - 998 3488
719 Broadway 12th Floor                 fax  +1 - 212 - 995 4122
New York, NY 10003, USA                 http://bioinformatics.cat.nyu.edu
                    "Hello New York! We'll do what we can!"
                           Bill Murray in `Ghostbusters'.
From: Martin Simmons
Subject: Re: Are CMUCL and ACL wrong? (Re: NO-APPLICABLE-METHOD usage.)
Date: 
Message-ID: <3c9f7347$0$225$ed9e5944@reading.news.pipex.net>
"Duane Rettig" <·····@franz.com> wrote in message
··················@beta.franz.com...
> Marco Antoniotti <·······@cs.nyu.edu> writes:
>
> > Marco Antoniotti <·······@cs.nyu.edu> writes:
> >
> > > Hi
> > >
> > > I have the following code.
> > >
> > >     (defgeneric foo (x y z))
> > >
> > >     (defmethod no-applicable-method ((x (eql #'foo)) &rest args)
> > >       (error 'my-special-error-here))
> > >
> > > Given the definition of NO-APPLICABLE-METHOD in the CLHS, is the above
> > > a legal use of it?
> > >
> >
> > Ok.  Nobody responded to this post.  But the kind folks at Lispworks
> > pointed out that LW (which forbids the above) may be right (cfr.
> > point 19 of 11.1.2.1.2), while CMUCL and ACL accept it.
> >
> > Any comments?
>
> I don't understand the problem.  Point 19 comes under the control of the
> first paragraph, which says "Except where explicitly allowed ..."
>
> And in the definition of no-applicable-method, The second sentence of the
> second sentence in the Descriptions section says "Programmers may write
> methods for it".

I can see that is a possible reading, but it would allow conforming programs to
define NO-APPLICABLE-METHODS methods specializing on T or FUNCTION, which
probably wasn't intended.  The point is moot now anyway, because we've relaxed
the checking to allow EQL specialization in cases like this.
--
Martin Simmons, Xanalys Software Tools
······@xanalys.com
rot13 to reply