writing to parameter / type-switch

Seth Alves alves@hungry.com
Sat Nov 29 15:09:00 GMT 2014


I'm trying to run some code that does roughly this:

(define (foo . opt)
   (set! opt (if (null? opt) #f (car opt)))
   opt)

(display (foo 1))
(newline)

./kawa-type-switch.scm:7:13: warning - type java.lang.Boolean is 
incompatible with required type list
./kawa-type-switch.scm:7:3: warning - cannot convert literal (of type 
java.lang.Boolean) to Type list
Value '1' for variable 'opt' has wrong type (integer) (gnu.math.IntNum 
cannot be cast to gnu.lists.LList)
     at kawa$Mntype$Mnswitch.foo$V(kawa-type-switch.scm:7)
     at kawa$Mntype$Mnswitch.applyN(kawa-type-switch.scm:6)
...

I can work around it, but is there a way to make kawa happy with this?

     -seth



More information about the Kawa mailing list