<div dir="ltr">I don't see that with this program:<div><br></div><div><div>#lang racket</div><div><br></div><div>(define (integer->roman n)</div><div> (cond ((not (integer? n))</div><div> (raise-argument-error 'integer->roman "integer?" n))</div>
<div> ((positive? n)</div><div> (apply string-append n))</div><div> ((negative? n)</div><div> (apply string-append "NEGATIVVS " 1))</div><div> (else</div><div> "NVLLA")))</div>
</div><div><br></div><div><div>Welcome to DrRacket, version 5.3.2.3--2013-01-29(32529d89/d) [3m].</div><div>Language: racket; memory limit: 128 MB.</div><div>> (integer->roman 3.3)</div><div>. . integer->roman: contract violation</div>
<div> expected: integer?</div><div> given: 3.3</div><div>> (integer->roman 3.3)</div><div>. . integer->roman: contract violation</div><div> expected: integer?</div><div> given: 3.3</div><div>> </div></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jan 29, 2013 at 4:33 PM, Pierpaolo Bernardi <span dir="ltr"><<a href="mailto:olopierpa@gmail.com" target="_blank">olopierpa@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>If I use raise-argument-error in my functions, like this:</div><div><br></div><div>(define (integer->roman n)</div>
<div> (cond ((not (integer? n))</div><div> (raise-argument-error 'integer->roman "integer?" n))</div>
<div> ((positive? n)</div><div> (apply string-append (positive-integer->roman n)))</div><div> ((negative? n)</div><div> (apply string-append "NEGATIVVS " (positive-integer->roman (- n))))</div>
<div> (else</div><div> "NVLLA")))</div><div><br></div><div>I get errors like this:</div><div><br></div><div><div>Welcome to DrRacket, version 5.3.2.2--2013-01-26(88404f3/a) [3m].</div><div>Language: racket [custom].</div>
<div>> (integer->roman 3.3)</div><div>integer->roman: contract violation</div><div> expected: integer?</div><div> given: 3.3</div><div>> (integer->roman 3.3)</div><div>. . C:\Program Files\Racket-Full-5.3.2.2\collects\racket\private\more-scheme.rkt:263:2: integer->roman: contract violation</div>
<div> expected: integer?</div><div> given: 3.3</div></div><div><br></div><div>That is, from the second time on I get the extraneous prefix. Is this expected?</div><span class="HOEnZb"><font color="#888888"><div><br></div>
<div>P.</div><div><br></div>
</font></span><br>_________________________<br>
Racket Developers list:<br>
<a href="http://lists.racket-lang.org/dev" target="_blank">http://lists.racket-lang.org/dev</a><br>
<br></blockquote></div><br></div>