Hi,
Alexandru Cojocaru <[email protected]> writes:
> is it possible to ignore errors when evaluating a badly formed
> expression?
Yes. An easy way is to use 'false-is-exception', like this:
(false-if-exception (primitive-eval '(this is an error)))
=> #f
However, this won't work if you need to tell the difference between the
evaluation returning #f and an error happening. In that case, try this:
(catch #t
(lambda ()
(primitive-eval '(this is an error)))
(lambda (key . args)
(display "An error occurred during evaluation.\n")))
Happy hacking!
Mark