Hello,
Is there a way to catch an unbound-variable exception, bind the
variable on the fly, and continue execution as if the exception didn't
occurs ?
I'd like to catch this exception in a c function: the exception context
should be available, to retrieve the variable or function name. This
Hi Neil,
Neil Jerram wrote:
Jon Wilson [EMAIL PROTECTED] writes:
(define-macro (dyn-set! var val)
`(begin (if (not (defined? (quote ,var)))
(primitive-eval `(define ,(quote ,var) #f)))
(set! ,var ,val)))
(defined? 'undefined-symbol)
Jon Wilson [EMAIL PROTECTED] writes:
(define-macro (dyn-set! var val)
`(begin (if (not (defined? (quote ,var)))
(primitive-eval `(define ,(quote ,var) #f)))
(set! ,var ,val)))
(defined? 'undefined-symbol) ; = #f
;(set!
Hello,
Is there a way to catch an unbound-variable exception, bind the
variable on the fly, and continue execution as if the exception didn't
occurs ?
I'd like to catch this exception in a c function: the exception context
should be available, to retrieve the variable or function name. This
Vincent De Groote [EMAIL PROTECTED] writes:
Is there a way to catch an unbound-variable exception, bind the
variable on the fly, and continue execution as if the exception didn't
occurs ?
No, unfortunately not (but read on below for an alternative solution
that doesn't use exceptions).