This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: signal error from my smob_func
- To: Sergey Dolin <dsa-ugur at chel dot surnet dot ru>
- Subject: Re: signal error from my smob_func
- From: Michael Livshin <mlivshin at bigfoot dot com>
- Date: 11 May 2000 13:33:22 +0300
- Cc: guile at sourceware dot cygnus dot com
- Organization: who? me?
- References: <m3ln1hgzcb.fsf@ugur.surnet.ru>
Sergey Dolin <dsa-ugur@chel.surnet.ru> writes:
> If all is ok my func would return new smob (object what is oracle session)
> If logon fail - func could return simple #f, but i do need the right
> smob to be returned in order to get error message...
>
> So this will not work:
> (let ((session (o:log "scott" "tiger" "mydb")))
> (if session
> (...)
> (display (o:erhms session))))
what about:
(let ((session (o:log "whatever")))
(cond
((o:error? session)
(display (o:ehrms session)))
(else
(...))))
?
the gist of which is: the returned object should be identifiable as an
error object (aka "condition object"). it could be just a string, for
all I know.
> Probably continuation will be better?
> ...Is where standard solution for what?
well, not standard in the ANSI sense, but at least there are some
standard approaches and terminology.
I think that the nicest approach is the "condition system" approach.
see http://srfi.schemers.org/srfi-12 (withdrawn, unfortunately, but
it's the right idea and may give you some methodological hints).
uspehov,
--mike
--
Politics is non-euclidean. -- Robert Anton Wilson