Nice. Thank you.<br><br><div class="gmail_quote">On Sat, Jun 2, 2012 at 6:35 PM, Sam Tobin-Hochstadt <span dir="ltr"><<a href="mailto:samth@ccs.neu.edu" target="_blank">samth@ccs.neu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The highlight (with apologies to Jacob):<br>
<br>
#lang typed/racket<br>
(: add-blaster : Number [#:y Number] -> Number)<br>
(define (add-blaster x #:y [y 5]) (+ x y)<br>
<br>
(add-blaster 1)<br>
(add-blaster 2 #:y 7)<br>
<br>
The details:<br>
<br>
Typed Racket now supports defining typed functions with keyword (and<br>
optional) arguments. To use this support, just write code as above,<br>
the same way you'd write TR functions normally. The typechecker<br>
should be able to figure everything out. If it doesn't, please file a<br>
bug report.<br>
<br>
There are a couple limitations, which we will remove eventually.<br>
First, `define:`, `lambda:`, and other such forms don't handle the<br>
keyword syntax. Thus, you need to use out-of-line annotations, as<br>
shown above. Second, the error messages you'll get when you have<br>
arity errors in the definition are suboptimal at the moment, and<br>
expose some of the implementation.<br>
<br>
Try it out, and let me know if anything doesn't seem to work right.<br>
<span class="HOEnZb"><font color="#888888">--<br>
sam th<br>
<a href="mailto:samth@ccs.neu.edu">samth@ccs.neu.edu</a><br>
____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</font></span></blockquote></div><br>