On Tue, Aug 10, 2010 at 02:15, Felix
<[email protected]> wrote:
> You can override the ##sys#reset-handler (for example using
> `parameterize'), which is just a thunk and by default invokes
> `exit'.

I thought you might say that.  Is it possible to document that this is
the official way to catch compilation errors?  Why does it call
(reset) instead of (error)?  (execute) calls its arguments in a
for-each loop, is it safe to escape out of this loop via call/cc from
the reset handler?  Do I need to worry about the stack?  Do I need to
worry the reset handler might be called due to a real exception?

This seems to work to convert the call to reset into an exception,
does it make sense?

 (let ((old-reset (##sys#reset-handler)))
   (parameterize ((##sys#reset-handler
                   (lambda ()
                     (parameterize ((##sys#reset-handler old-reset))
                       (error 'execute "compilation error")))))
     (compile file.scm)))

_______________________________________________
Chicken-hackers mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-hackers

Reply via email to