This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
nested functions and #!optional
- From: Chuah Teong Leong <teongleong at gmail dot com>
- To: kawa at sourceware dot org
- Date: Fri, 27 Jul 2012 00:06:46 +0800
- Subject: nested functions and #!optional
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)