[armedbear-ticket] [armedbear] #199: CL:DEFMETHOD cannot parse &AUX arguments
armedbear
armedbear-devel at common-lisp.net
Wed Feb 29 09:48:35 UTC 2012
#199: CL:DEFMETHOD cannot parse &AUX arguments
------------------------------+---------------------------------------------
Reporter: mevenson | Owner: mevenson
Type: defect | Status: assigned
Priority: critical | Milestone: 1.1.0
Component: (A)MOP | Version: 1.1.0-dev
Keywords: quicklisp restas |
------------------------------+---------------------------------------------
Description changed by mevenson:
Old description:
> The code
> [source:/trunk/abcl/src/org/armedbear/lisp/ArgumentProcessor.java] does
> not handle &AUX arguments for CL:DEFMETHOD correctly.
>
> After defining the APPLY-RULE generic function as such:
>
> {{{
> (defgeneric apply-rule (rule))
> (defmethod apply-rule ((rule t) &aux (context (format nil "~A" rule)))
> (format nil "Applying rule '~A' in context '~A'" rule context))
> }}}
>
> then
> {{{
> CL-USER> (apply-rule "1")
> }}}
>
> will fail with errors in
>
> {{{
>
> Wrong number of arguments for #<FUNCTION (LAMBDA (ARGS NEXT-EMFUN))
> {756AF1BA}>; 2 expected.
> [Condition of type PROGRAM-ERROR]
>
> Restarts:
> 0: [RETRY] Retry SLIME REPL evaluation request.
> 1: [*ABORT] Return to SLIME's top level.
> 2: [ABORT] Abort thread.
>
> Backtrace:
> 0: (#<FUNCTION {4024268F}> #<PROGRAM-ERROR {27ABBCDA}> #<FUNCTION
> {4024268F}>)
> 1: (APPLY #<FUNCTION {4024268F}> (#<PROGRAM-ERROR {27ABBCDA}>
> #<FUNCTION {4024268F}>))
> 2: (SYSTEM::RUN-HOOK SYSTEM::*INVOKE-DEBUGGER-HOOK* #<PROGRAM-ERROR
> {27ABBCDA}> #<FUNCTION {4024268F}>)
> 3: (INVOKE-DEBUGGER #<PROGRAM-ERROR {27ABBCDA}>)
> 4: org.armedbear.lisp.Lisp.error(Lisp.java:379)
> 5:
> org.armedbear.lisp.ArgumentListProcessor$FastMatcher.match(ArgumentListProcessor.java:642)
> 6:
> org.armedbear.lisp.ArgumentListProcessor.match(ArgumentListProcessor.java:459)
> 7: org.armedbear.lisp.Closure.execute(Closure.java:205)
> 8: org.armedbear.lisp.Closure.execute(Closure.java:139)
> 9: org.armedbear.lisp.clos_221.execute(clos.lisp:1910)
> 10:
> org.armedbear.lisp.FuncallableStandardObject.execute(FuncallableStandardObject.java:99)
> 11: org.armedbear.lisp.LispThread.execute(LispThread.java:649)
> 12: org.armedbear.lisp.Lisp.evalCall(Lisp.java:550)
> 13: org.armedbear.lisp.Lisp.eval(Lisp.java:515)
> 14: org.armedbear.lisp.Primitives$pf__eval.execute(Primitives.java:345)
> 15: (#<STANDARD-GENERIC-FUNCTION APPLY-RULE {3C3A157E}> "1")
>
> }}}
New description:
The code recently refactored by Erik in
[source:/trunk/abcl/src/org/armedbear/lisp/ArgumentListProcessor.java]
does not handle &AUX arguments for CL:DEFMETHOD correctly.
After defining the APPLY-RULE generic function as such:
{{{
(defgeneric apply-rule (rule))
(defmethod apply-rule ((rule t) &aux (context (format nil "~A" rule)))
(format nil "Applying rule '~A' in context '~A'" rule context))
}}}
then
{{{
CL-USER> (apply-rule "1")
}}}
will fail with errors in
{{{
Wrong number of arguments for #<FUNCTION (LAMBDA (ARGS NEXT-EMFUN))
{756AF1BA}>; 2 expected.
[Condition of type PROGRAM-ERROR]
Restarts:
0: [RETRY] Retry SLIME REPL evaluation request.
1: [*ABORT] Return to SLIME's top level.
2: [ABORT] Abort thread.
Backtrace:
0: (#<FUNCTION {4024268F}> #<PROGRAM-ERROR {27ABBCDA}> #<FUNCTION
{4024268F}>)
1: (APPLY #<FUNCTION {4024268F}> (#<PROGRAM-ERROR {27ABBCDA}> #<FUNCTION
{4024268F}>))
2: (SYSTEM::RUN-HOOK SYSTEM::*INVOKE-DEBUGGER-HOOK* #<PROGRAM-ERROR
{27ABBCDA}> #<FUNCTION {4024268F}>)
3: (INVOKE-DEBUGGER #<PROGRAM-ERROR {27ABBCDA}>)
4: org.armedbear.lisp.Lisp.error(Lisp.java:379)
5:
org.armedbear.lisp.ArgumentListProcessor$FastMatcher.match(ArgumentListProcessor.java:642)
6:
org.armedbear.lisp.ArgumentListProcessor.match(ArgumentListProcessor.java:459)
7: org.armedbear.lisp.Closure.execute(Closure.java:205)
8: org.armedbear.lisp.Closure.execute(Closure.java:139)
9: org.armedbear.lisp.clos_221.execute(clos.lisp:1910)
10:
org.armedbear.lisp.FuncallableStandardObject.execute(FuncallableStandardObject.java:99)
11: org.armedbear.lisp.LispThread.execute(LispThread.java:649)
12: org.armedbear.lisp.Lisp.evalCall(Lisp.java:550)
13: org.armedbear.lisp.Lisp.eval(Lisp.java:515)
14: org.armedbear.lisp.Primitives$pf__eval.execute(Primitives.java:345)
15: (#<STANDARD-GENERIC-FUNCTION APPLY-RULE {3C3A157E}> "1")
}}}
--
--
Ticket URL: <http://trac.common-lisp.net/armedbear/ticket/199#comment:7>
armedbear <http://common-lisp.net/project/armedbear>
armedbear
More information about the armedbear-ticket
mailing list