That fixes it for me. Thanks, both of you!<br><br><div class="gmail_quote">On Thu, Apr 12, 2012 at 12:27 AM, 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"><div>On Wed, Apr 11, 2012 at 3:36 PM, Timothy Nelson <<a href="mailto:tbnelson@gmail.com" target="_blank">tbnelson@gmail.com</a>> wrote:<br>
><br>
> I'd like to write a function that consumes an s-expression and produces a<br>
> struct -- something similar to building a tree struct out of a tree sexp. In<br>
> the past, I've always used match for this kind of sexp manipulation.<br>
> However, if I have a match clause within a function like this:<br>
><br>
> (: my-func (Sexp -> mystruct))<br>
> (define (my-func s)<br>
> (match s<br>
> [(list args ...) (make-mystruct (map my-func args))]))<br>
<br>
</div>The problem here is that Typed Racket can't guess what type you mean<br>
for `args' to have, so you have to tell it when you bind `args'. That<br>
looks like this:<br>
<div><br>
(: my-func (Sexp -> mystruct))<br>
(define (my-func s)<br>
(match s<br>
</div> [(list #{args : (Listof Sexp)} ...)<br>
<div> (make-mystruct (map my-func args))]))<br>
<br>
</div>which typechecks correctly for me.<br>
<font color="#888888">--<br>
sam th<br>
<a href="mailto:samth@ccs.neu.edu" target="_blank">samth@ccs.neu.edu</a><br>
</font></blockquote></div><br>