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)
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
h
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!
Hi Vincent,
Don't try this just yet. I want other people to give it a look-over and
make sure it isn't foolish and dangerous before anybody lets it out in the
wild.
This doesn't use the exception, and it doesn't use a c function, and it
doesn't do database lookups. However, it can be used
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).
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
h