Guile Mailing List Archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Interest in xfig




> Is there a suggested manner for handling the ``dead object'' error?
> Should functions return #f or should the script crash? For that matter,
> is there any centralised method for handling errors in guile? Suppose I
> write a handy couple of scheme routines... is it OK to call (error) in
> the middle of one of them or will this lead to a situation where those
> routines cannot be used by some project?

You should call scm_error to report the error.  Then your clients
don't have to check for #f all the time, but can handle errors if
they're expecting them, and the REPL can report problems gracefully.

See throw.c for functions you can use to handle errors; the code is
pretty thoroughly documented.

Guile Home | Main Index | Thread Index