Re: Allegro and Sbcl disagree on no-primary-method behavior
- From: tar@xxxxxxxxxxxxx (Thomas A. Russ)
- Date: 29 May 2008 14:00:16 -0700
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 correctbehavior.
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.
--
Thomas A. Russ, USC/Information Sciences Institute
.
- Follow-Ups:
- Re: Allegro and Sbcl disagree on no-primary-method behavior
- From: Jim Newton
- Re: Allegro and Sbcl disagree on no-primary-method behavior
- References:
- Allegro and Sbcl disagree on no-primary-method behavior
- From: Jim Newton
- Allegro and Sbcl disagree on no-primary-method behavior
- Prev by Date: Re: Allegro and Sbcl disagree on no-primary-method behavior
- Next by Date: Loop Alternatives
- 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):
Relevant Pages
|
|