[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-kawa] [bug #18504] Cannot generate (define-simple-class) using synt
From: |
Margus Freudenthal |
Subject: |
[Bug-kawa] [bug #18504] Cannot generate (define-simple-class) using syntax-case macros |
Date: |
Mon, 11 Dec 2006 14:04:58 +0000 |
User-agent: |
Opera/9.02 (X11; Linux i686; U; en) |
Follow-up Comment #1, bug #18504 (project kawa):
Additionally, the following macro works in REPL, but fails when compiling.
(define-syntax aa
(lambda (x)
(syntax-case x ()
((_ cl arg)
(with-syntax
((param-name (datum->syntax-object
#`arg
(string->symbol
(string-append
"param-"
(symbol->string (syntax-object->datum #`arg)))))))
#`(define-simple-class cl ()
(param-name)))))))
(aa MyClass oioi)
java.lang.NullPointerException
at gnu.expr.ReferenceExp.apply(ReferenceExp.java:142)
at gnu.mapping.CallContext.runUntilDone(CallContext.java:251)
at gnu.mapping.CallContext.getFromContext(CallContext.java:280)
at gnu.expr.Expression.eval(Expression.java:24)
at gnu.expr.ApplyExp.apply(ApplyExp.java:63)
at gnu.mapping.CallContext.runUntilDone(CallContext.java:251)
at gnu.mapping.CallContext.getFromContext(CallContext.java:280)
at gnu.expr.Expression.eval(Expression.java:24)
at gnu.expr.IfExp.apply(IfExp.java:33)
at gnu.mapping.CallContext.runUntilDone(CallContext.java:251)
at gnu.mapping.CallContext.getFromContext(CallContext.java:280)
at gnu.expr.Expression.eval(Expression.java:24)
at gnu.expr.BlockExp.apply(BlockExp.java:46)
at gnu.expr.LetExp.apply(LetExp.java:64)
at gnu.expr.LetExp.apply(LetExp.java:64)
at gnu.expr.IfExp.apply(IfExp.java:34)
at gnu.mapping.CallContext.runUntilDone(CallContext.java:251)
at gnu.mapping.CallContext.getFromContext(CallContext.java:280)
at gnu.expr.Expression.eval(Expression.java:24)
at gnu.expr.BlockExp.apply(BlockExp.java:46)
at gnu.expr.LetExp.apply(LetExp.java:64)
at gnu.expr.Closure.apply(LambdaExp.java:1906)
at gnu.mapping.CallContext.runUntilDone(CallContext.java:251)
at gnu.mapping.CallContext.runUntilValue(CallContext.java:315)
at gnu.mapping.MethodProc.applyN(MethodProc.java:105)
at gnu.mapping.ProcedureN.apply1(ProcedureN.java:31)
at kawa.lang.Macro.expand(Macro.java:178)
at kawa.lang.Macro.scanForm(Macro.java:206)
at kawa.lang.Translator.scanForm(Translator.java:959)
at gnu.kawa.lispexpr.LispLanguage.parse(LispLanguage.java:69)
at gnu.expr.Language.parse(Language.java:547)
at gnu.expr.Language.parse(Language.java:523)
at kawa.repl.compileFiles(repl.java:728)
at kawa.repl.processArgs(repl.java:425)
at kawa.repl.main(repl.java:827)
(compiling test-macro.scm)
test-macro.scm:24:1: evaluating syntax transformer 'aa' threw
java.lang.NullPointerException
However, the following variant compiles OK:
(define-syntax aa
(lambda (x)
(syntax-case x ()
((_ cl arg)
#`(define-simple-class cl ()
(,(datum->syntax-object
#`arg
(string->symbol
(string-append
"param-"
(symbol->string (syntax-object->datum #`arg)))))))))))
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?18504>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/