<div dir="ltr">I'm new to Typed Racket and want to define an optional parameter. I found (->*) in the docs, but trying out the example<div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
#lang typed/racket<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
(: append-bar (->* (String) (Positive-Integer) String))<br>(define (append-bar str [how-many 1])<br> (apply string-append str (make-list how-many "bar")))</blockquote></div><div><br></div><div>gives me this error in 6.0:</div>
<div><br><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><font color="#ff0000">Type Checker: not a valid type: (String)</font> in: <font color="#ff0000">(String)</font></blockquote>
<div><br></div><div>Am I missing something obvious?</div></div><div><br></div><div>Dan</div></div></div>