[racket-dev] differences in error reporting
If I use raise-argument-error in my functions, like this:
(define (integer->roman n)
(cond ((not (integer? n))
(raise-argument-error 'integer->roman "integer?" n))
((positive? n)
(apply string-append (positive-integer->roman n)))
((negative? n)
(apply string-append "NEGATIVVS " (positive-integer->roman (- n))))
(else
"NVLLA")))
I get errors like this:
Welcome to DrRacket, version 5.3.2.2--2013-01-26(88404f3/a) [3m].
Language: racket [custom].
> (integer->roman 3.3)
integer->roman: contract violation
expected: integer?
given: 3.3
> (integer->roman 3.3)
. . C:\Program
Files\Racket-Full-5.3.2.2\collects\racket\private\more-scheme.rkt:263:2:
integer->roman: contract violation
expected: integer?
given: 3.3
That is, from the second time on I get the extraneous prefix. Is this
expected?
P.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20130129/22af59e2/attachment-0001.html>