Re: [racket-users] Defining new exception types with guards and default messages

2017-06-29 Thread David Storrs
Good to know. I'll do it that way. On Thu, Jun 29, 2017 at 11:26 AM, Philip McGrath wrote: > Note, though, (having tried this) that putting a contract on the guard > will give you undesirable blame behavior unless you use any/c for all the > domain contracts as

Re: [racket-users] Defining new exception types with guards and default messages

2017-06-29 Thread Philip McGrath
Note, though, (having tried this) that putting a contract on the guard will give you undesirable blame behavior unless you use any/c for all the domain contracts as Matthias did. The guard must be able to accept all arguments, so the server module will be blamed if a client calls the constructor

Re: [racket-users] Defining new exception types with guards and default messages

2017-06-29 Thread David Storrs
On Thu, Jun 29, 2017 at 9:50 AM, Matthias Felleisen wrote: > > > On Jun 29, 2017, at 9:21 AM, David Storrs > wrote: > > > > I'd like to create a new exception type, 'exn:fail:insufficient-space', > something like this: > > > > (struct

Re: [racket-users] Defining new exception types with guards and default messages

2017-06-29 Thread Matthias Felleisen
> On Jun 29, 2017, at 9:21 AM, David Storrs wrote: > > I'd like to create a new exception type, 'exn:fail:insufficient-space', > something like this: > > (struct exn:fail:insufficient-space exn:fail (requested available source)) > > I would like to do two things: > >

[racket-users] Defining new exception types with guards and default messages

2017-06-29 Thread David Storrs
I'd like to create a new exception type, 'exn:fail:insufficient-space', something like this: (struct exn:fail:insufficient-space exn:fail (requested available source)) I would like to do two things: 1) Make the exn-message field be standardized so that the person throwing the exception doesn't