[r6rs-discuss] Raise-continuable and raise question

Ben Simon benjisimon at gmail.com
Mon Jul 16 00:09:16 EDT 2007


On 7/15/07, Thomas Lord <lord at emf.net> wrote:
>
> Ben Simon wrote:
> >
> > Now, what about a higher level case - something like I originally
> > mentioned.  You go to open a DB connection, and it fails. Is the raise
> > continuable or not?  I'm not trying to be difficult here, I'm honestly
> > not sure which type it should be.
>
> I have no idea.  The problem is to vague, as you have specified it.
> It's meaningless (at least to me).


Good Point. How about this:

(define (open-db-connection host port username password)
  (let ((raw-tcp-conn (open-tcp-connection host port)))
    (if (not raw-tcp-conn)
        (raise "Unable to open db connection"))
    (authenticate-connection raw-tcp-conn username password)))

Assume that:
  open-tcp-connection opens up a TCP/IP connection, or returns #f if it
can't.
  authenticate-connection takes a raw TCP/IP connection and sends various
   packets across it to make sure it's a valid connection. The return of
   authenticate-connection is a valid connection.

So, the question is, should the above be raise or raise-continuable?
Obviously, this is toy code. But, I think the essence of the problem is
there.

-Ben

-- 
Ben Simon
My blog: http://benjisimon.blogspot.com
tenspotting.com - Top 10 Lists++
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.r6rs.org/pipermail/r6rs-discuss/attachments/20070716/359db1d2/attachment.htm 


More information about the r6rs-discuss mailing list