But that does hide the intent of the case-lambda usage, which is captured in the original.<br><br><div class="gmail_quote">On Mon, Oct 25, 2010 at 8:21 AM, Sam Tobin-Hochstadt <span dir="ltr"><<a href="mailto:samth@ccs.neu.edu">samth@ccs.neu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On Mon, Oct 25, 2010 at 10:06 AM, Doug Williams<br>
<div class="im"><<a href="mailto:m.douglas.williams@gmail.com">m.douglas.williams@gmail.com</a>> wrote:<br>
><br>
</div><div class="im">> (case-> (->r ((r random-source?)<br>
> (a real?)<br>
> (b (>/c a)))<br>
> real?)<br>
> (->r ((a real?)<br>
> (b (>/c a)))<br>
> real?)))<br>
><br>
> I'm not sure that one can be easily rewritten in the current contract<br>
> system. [I think I would have to move the b > a constraint into the code<br>
> itself in the current contract system. Or, change the argument order and<br>
> break backward compatibility.]<br>
<br>
</div>This can be written as a dependent contract, but with worse error messages.<br>
<br>
(->i ([r/a (or/c random-source? real?)] [a/b real?])<br>
([b/opt (r/a a/b) (if (random-source? r/a) (>/c a/b) none/c)])<br>
[result real?])<br>
<font color="#888888"><br>
--<br>
sam th<br>
<a href="mailto:samth@ccs.neu.edu">samth@ccs.neu.edu</a><br>
</font></blockquote></div><br>