[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-kawa] [bugs #11858] internal compile error in recursive define-synt
From: |
Steve Yegge |
Subject: |
[Bug-kawa] [bugs #11858] internal compile error in recursive define-syntax |
Date: |
Sat, 5 Feb 2005 16:08:46 +0000 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0 |
URL:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=11858>
Summary: internal compile error in recursive define-syntax
Project: Kawa
Submitted by: stevey
Submitted on: Sat 02/05/2005 at 16:08
Category: Code generation
Severity: 5 - Average
Item Group: Compile-time exception
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
_______________________________________________________
Details:
The definitions of cond and case from Dyvbig's book
(http://www.scheme.com/tspl3/syntax.html#./syntax:h3)
both throw NullPointerExceptions when you try to
evaluate them in 1.7.91.
(define-syntax cond
(lambda (x)
(syntax-case x ()
((_ c1 c2 ...)
(let f ((c1 (syntax c1)) (cmore (syntax (c2 ...))))
(if (null? cmore)
(syntax-case c1 (else =>)
((else e1 e2 ...) (syntax (begin e1 e2 ...)))
((e0) (syntax (let ((t e0)) (if t t))))
((e0 => e1) (syntax (let ((t e0)) (if t (e1 t)))))
((e0 e1 e2 ...) (syntax (if e0 (begin e1 e2 ...)))))
(with-syntax ((rest (f (car cmore) (cdr cmore))))
(syntax-case c1 (=>)
((e0) (syntax (let ((t e0)) (if t t rest))))
((e0 => e1) (syntax (let ((t e0)) (if t (e1 t) rest))))
((e0 e1 e2 ...)
(syntax (if e0 (begin e1 e2 ...) rest)))))))))))
<stdin>:1311:3: internal compile error - caught
java.lang.NullPointerException
java.lang.NullPointerException
at gnu.expr.Compilation.mangleName(Compilation.java:584)
at gnu.expr.Compilation.mangleName(Compilation.java:558)
at gnu.expr.LambdaExp.enterFunction(LambdaExp.java:1125)
at gnu.expr.LambdaExp.compileAsMethod(LambdaExp.java:1418)
at gnu.expr.LambdaExp.compile(LambdaExp.java:660)
at gnu.expr.Expression.compileNotePosition(Expression.java:98)
at gnu.expr.PrimProcedure.compileArgs(PrimProcedure.java:405)
at gnu.expr.PrimProcedure.compile(PrimProcedure.java:448)
at gnu.expr.PrimProcedure.compile(PrimProcedure.java:439)
at gnu.expr.ApplyExp.compile(ApplyExp.java:169)
at gnu.expr.ApplyExp.compile(ApplyExp.java:119)
at gnu.expr.Expression.compile(Expression.java:108)
at gnu.expr.BindingInitializer.emit(BindingInitializer.java:66)
at gnu.expr.Compilation.generateConstructor(Compilation.java:1115)
at gnu.expr.LambdaExp.compileEnd(LambdaExp.java:512)
at gnu.expr.Compilation.addClass(Compilation.java:1959)
at gnu.expr.Compilation.compile(Compilation.java:901)
at gnu.expr.ModuleExp.evalToClass(ModuleExp.java:77)
at gnu.expr.ModuleExp.evalModule(ModuleExp.java:196)
at kawa.Shell.run(Shell.java:231)
at kawa.Shell.run(Shell.java:177)
at kawa.Shell.run(Shell.java:164)
at kawa.Shell.run(Shell.java:151)
at kawa.repl.main(repl.java:672)
(the case example throws the same exception)
I haven't been able to narrow it down much. Here's a very stripped-down
version of the cond macro above, which throws the same exception:
(define-syntax nonsense
(lambda (x)
(syntax-case x ()
((_ c1 c2)
(let f ((c1 (syntax c1)) (cmore (syntax (c2))))
(with-syntax ((rest (f (car cmore) (cdr cmore))))
(syntax (#t))))))))
_______________________________________________________
This item URL is:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=11858>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug-kawa] [bugs #11858] internal compile error in recursive define-syntax,
Steve Yegge <=