This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Bug with let-values?


Thanks!

I don't know if this is related, but I got a similar problem with a
combination of let-values/syntax-case/with-syntax/syntax (I'm currently
doing a bit of complex macrology...):

(define-syntax test-syntax
  (lambda (stx)
    (syntax-case stx ()
      ((_ args ...)
       (let-values (((x y) (foo (syntax (args ...)))))
         (with-syntax ((v x) (w y))
           (syntax 
            (begin (v) (w)))))))))


When I evaluate that form, I get:

<stdin>:3:3: internal compile error - caught java.lang.NullPointerException
java.lang.NullPointerException
        at gnu.expr.Compilation.isValidJavaName(Compilation.java:586)
        at gnu.expr.Compilation.mangleNameIfNeeded(Compilation.java:578)
        at gnu.expr.Declaration.makeField(Declaration.java:775)
        at gnu.expr.LambdaExp.enterFunction(LambdaExp.java:1137)
        at gnu.expr.LambdaExp.compileAsMethod(LambdaExp.java:1427)
        at gnu.expr.LambdaExp.compile(LambdaExp.java:666)
        at gnu.expr.Expression.compileNotePosition(Expression.java:127)
       ...

(this is using the latest Kawa in CVS)

Dominique
 
> Actually, the bug has nothing to do with let-values.  The problem is
> that since 'loop' is only called, not read, then it gets compiled to
> (just a) method. (There is no actual object for loop.)  Hence it get
> compiled at a later time, at which point it would add entries to
> initialize the fields that reference the two nested lambda 
> expressions.
> Unfortunately, by that code we had already run the code that walks
> the chain of pending initializers.
> 
> Bottom line: another example of the compiler doing things in the
> wrong order.
> 
> I checked in a patch (to gnu/expr/Compilation.java) into CVS.
> 
> Whether it makes it into 1.8 depends on whether I do a re-spin,
> which depends on how soon the FSF gets back to me about how to
> upload to ftp.gnu.org.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]