<div dir="ltr">It would be very helpful to me to have an example of the &quot;local&quot; form for defining an internal function in typed racket. I&#39;ve read and re-read the docs and can&#39;t seem to figure it out from the syntax definition. <div>

<br></div><div style>Here&#39;s what i&#39;ve been trying:</div><div><div><br></div><div>(: make-random-emetype-list (Range -&gt; (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 -&gt; (Listof EmeType))</div><div>            (cond [(&lt; remaining 1) lst]</div><div>                  [else (bld-lst (cons (new-emetype) lst) (- remaining 1))])])</div>

<div>    (bld-lst &#39;() how-many-types)))</div></div><div><br></div><div style>but I get an error on this: &quot;define:: expected the identifier `:&#39; in: ((Listof EmeType) Integer -&gt; (Listof EmeType))&quot;</div>

<div style><br></div><div style>Thanks for the help!</div><div style><br></div><div style>Ben</div></div>