This works completely fine on a fresh racket REPL:

> (exn:fail:bmtc:unknown-user "message" (current-continuation-marks) "bob")
(exn:fail:bmtc:unknown-user "message" #<continuation-mark-set> "bob")

I guess there might be some inconsistency in REPL states. Starting a
fresh racket should work, or maybe use (enter! "./module.rkt")?

Best,
Shu-Hung


On Fri, Feb 17, 2017 at 12: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.

-- 
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