<div dir="ltr">It would be very helpful to me to have an example of the "local" form for defining an internal function in typed racket. I've read and re-read the docs and can't seem to figure it out from the syntax definition. <div>
<br></div><div style>Here's what i've been trying:</div><div><div><br></div><div>(: make-random-emetype-list (Range -> (Listof EmeType)))</div><div>(define (make-random-emetype-list range )</div><div> (local ([define how-many-types (random-integer (Range-lower range) (Range-upper range))]</div>
<div> [define: (bld-lst lst remaining) : ((Listof EmeType) Integer -> (Listof EmeType))</div><div> (cond [(< remaining 1) lst]</div><div> [else (bld-lst (cons (new-emetype) lst) (- remaining 1))])])</div>
<div> (bld-lst '() how-many-types)))</div></div><div><br></div><div style>but I get an error on this: "define:: expected the identifier `:' in: ((Listof EmeType) Integer -> (Listof EmeType))"</div>
<div style><br></div><div style>Thanks for the help!</div><div style><br></div><div style>Ben</div></div>