nested functions and #!optional

Chuah Teong Leong teongleong@gmail.com
Thu Jul 26 16:07:00 GMT 2012


I've got a situation where it unexpectedly throws an exception which puzzled me.

(define (func)
  (define (nested-func #!optional arg)
    (set! arg "any string"))
  (nested-func))

(func)

doing the above throws this
java.lang.ClassCastException: java.lang.Boolean cannot be casted to
java.lang.String

while this is fine

(define (nested-func #!optional arg)
    (set! arg "bugged"))

(nested-func)



More information about the Kawa mailing list