This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
null pointer during macro expansion
- From: Seth Alves <alves at hungry dot com>
- To: kawa at sourceware dot org
- Date: Wed, 26 Nov 2014 14:01:16 -0800
- Subject: null pointer during macro expansion
- Authentication-results: sourceware.org; auth=none
This is boiled down from srfi-42, and I'm not sure it's even valid
code. I'm having trouble making it any smaller without the problem
vanishing:
<unknown>: caught exception in inline-compiler for list
gnu.lists.LList.reverseInPlace(java.lang.Object) -
java.lang.NullPointerException
gnu.expr.LambdaExp.enterFunction(LambdaExp.java:1290)
gnu.expr.ApplyExp.compile(ApplyExp.java:391)
gnu.expr.ApplyExp.compile(ApplyExp.java:190)
...
If this is too big, let me know and I'll try harder to trim something out.
-seth
#! /bin/sh
#| -*- scheme -*-
exec /usr/local/bin/kawa \
-Dkawa.import.path='./*.sld' \
-Dkawa.include.path='|:.' \
$0 "$@"
|#
(define-library (foo)
(export :do)
(import (scheme base))
(begin
(define-syntax :do
(syntax-rules ()
((:do (cc ...) olet lbs ne1? ilet ne2? lss)
(cc ... (:do olet lbs ne1? ilet ne2? lss)))))
(define-syntax :list
(syntax-rules ()
((:list cc var arg)
(:do cc
(let ())
((t arg))
#t
(let ((var #t)))
#t
((cdr t))))))
(define-syntax :generator-proc
(syntax-rules (:do let)
((:generator-proc (g arg ...))
(g (:generator-proc var) var arg ...) )
((:generator-proc
var
(:do (let obs oc ...)
((lv li) ...)
ne1?
(let ((i v) ...) ic ...)
ne2?
(ls ...)) )
(let obs
oc ...
(let ((lv li) ... (ne2 #t))
#t)))))
(define (make-initial-:-dispatch)
(lambda (args)
(case (length args)
((0) 'SRFI42)
(else
(:generator-proc
(:list
(apply append (map vector->list '()))))))))
(define :-dispatch
(make-initial-:-dispatch))))
(import (scheme base)
(scheme write)
(foo))
#t