[plt-scheme] Idiomatic equivalent to exn:application in v299?

From: Daniel Pinto de Mello e Silva (daniel.silva at gmail.com)
Date: Mon Feb 7 03:52:16 EST 2005

On Sun, 6 Feb 2005 13:47:51 -0500, Richard Cobbe <cobbe at ccs.neu.edu> wrote:
> Greetings, all.
> I'm in the process of porting some old libraries from 208 to 299, and
> I'm struggling a little bit with the new exception hierarchy.
> Here's an example: I've got a library for implementing standard rib-cage
> environments.  In the old version, the lookup function would raise an
> exn:application:mismatch exception if the requested identifier is not
> bound, and I'd put the unbound identifier into the exception's value
> field.  (This follows hash-table-get's interface.)
> What's the idiomatic equivalent under v299?  It appears from the docs
> that the exn:fail:contract exception is the replacement for
> exn:application:mismatch, but there's no value field.  Is there a
> standard equivalent?  I'd really prefer not to marshal the value into
> the message string, as the new hash-table-get does.

Why not write (define-struct (exn:lookup exn) (id)) ?


Posted on the users mailing list.