SCM now has routines to make calling back to Scheme procedures easier.
The source code for these routines are found in `rope.c'.
Init.scm'.
(in-vicinity (program-vicinity) file). Returns 0 if successful, non-0 if not.
This function is useful for compiled code init_ functions to load
non-compiled Scheme (source) files. program-vicinity is the
directory from which the calling code was loaded (see Vicinity).
If you wish to catch errors during execution of Scheme code, then you can use a wrapper like this for your Scheme procedures:
(define (srv:protect proc)
(lambda args
(define result #f) ; put default value here
(call-with-current-continuation
(lambda (cont)
(dynamic-wind (lambda () #t)
(lambda ()
(set! result (apply proc args))
(set! cont #f))
(lambda ()
(if cont (cont #f))))))
result))
Calls to procedures so wrapped will return even if an error occurs.