Re: Allegro and Sbcl disagree on no-primary-method behavior
- From: Jim Newton <jimka@xxxxxxxxxxx>
- Date: Fri, 30 May 2008 09:16:32 +0200
the problem with defining this "stand-in" method would be that now
NEXT-METHOD-P would return TRUE. which would be even more misleading.
-jim
Thomas A. Russ wrote:
Jim Newton <jimka@xxxxxxxxxxx> writes:
Does anyone know what the behavior should be if a generic function has
an around method which does NOT call call-next-method, but there is
no primary method?
...
(defgeneric foo (x))
(defmethod foo :around (x) 1)
(foo 1)
This returns 1 in allegro, and errors in sbcl. Any opinions
about which is correct behavior?
From the other posts, it appears that signaling the error is correct
behavior.
It would be pretty easy to get something like the Allegro behavior, but
in an ANSI-compliant way by just adding a default primary method that
signals an error:
(defmethod foo (x) (error "Shouldn't get here."))
This would allow the around method to work as long as it didn't try to
actually get to the primary method.
--
+------------------------------------------------------------------------+
| Jim E. Newton (jimka@xxxxxxxxxxx) desk +49-(0)89-4563-1918 |
| Methodology Services Europe fax +49-(0)89-4563-1819 |
| Cadence Design Systems GmbH Munich Germany |
| |
| If you won't do it in the rain, you won't do it. |
+------------------------------------------------------------------------+
.
- Follow-Ups:
- Re: Allegro and Sbcl disagree on no-primary-method behavior
- From: Pascal Costanza
- Re: Allegro and Sbcl disagree on no-primary-method behavior
- References:
- Allegro and Sbcl disagree on no-primary-method behavior
- From: Jim Newton
- Re: Allegro and Sbcl disagree on no-primary-method behavior
- From: Thomas A. Russ
- Allegro and Sbcl disagree on no-primary-method behavior
- Prev by Date: Re: C++ program as a Lisp expression
- Next by Date: Re: New notation
- Previous by thread: Re: Allegro and Sbcl disagree on no-primary-method behavior
- Next by thread: Re: Allegro and Sbcl disagree on no-primary-method behavior
- Index(es):