Oh.  When I change the name to exn:fail:bmtc:unknownuser  it works fine.  I
guess '-' is a disallowed character for exceptions?

-> (struct exn:fail:bmtc:unknownuser exn:fail:bmtc (username) #:transparent)

-> (exn:fail:bmtc:unknownuser "msg" (current-continuation-marks) "foo")
(exn:fail:bmtc:unknownuser "msg" #<continuation-mark-set> ... "foo")



Underscore also works:

-> (struct exn:fail:bmtc:unknown_user exn:fail:bmtc (username)
#:transparent)

-> (exn:fail:bmtc:unknown_user "msg" #<continuation-mark-set> ... "foo")
(exn:fail:bmtc:unknown_user "msg" #<continuation-mark-set> ... "foo")



On Fri, Feb 17, 2017 at 1:17 PM, David Storrs <david.sto...@gmail.com>
wrote:

> I have the following file:
>
>
> #lang racket
>
> (provide (all-defined-out))
>
> (struct exn:fail:bmtc exn:fail ()
>     #:extra-constructor-name make-exn:fail:bmtc
>     #:transparent)
>
> ;; I expect this to take all the arguments from exn (its ultimate
> superclass), plus a new argument which comes last.
> (struct exn:fail:bmtc:unknown-user exn:fail:bmtc (username)
>     #:extra-constructor-name make-exn:fail:bmtc:unknown-user
>     #:transparent)
>
>
> At the command line:
>
> $ racket
> -> (require "network/exceptions")
>
> -> exn:fail:bmtc:unknown-user
> #<procedure:exn:fail:bmtc:unknown-user>
>
> -> (exn:fail:bmtc:unknown-user "message" (current-continuation-marks)
> "bob")
> ; exn:fail:bmtc:unknown-user: arity mismatch;
> ;  the expected number of arguments does not match the given number
> ;   expected: 2
> ;   given: 3
> ; [,bt for context]
>
> -> (exn:fail:bmtc:unknown-user "msg" (current-continuation-marks))
> (exn:fail:bmtc:unknown-user "msg" #<continuation-mark-set>)
>
>
> Given the declaration of exn:fail:bmtc:unknown-user I was expecting it to
> take a third argument.  What am I missing?
>
>
> Note that I'm using Emacs and the command line, not DrRacket.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to