<div dir="ltr">You want generic-bind:<div><br></div><div><a href="http://stchang.github.io/generic-bind/generic-bind.html">http://stchang.github.io/generic-bind/generic-bind.html</a><br></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Tue, Sep 3, 2013 at 3:32 AM, Konrad Hinsen <span dir="ltr"><<a href="mailto:konrad.hinsen@fastmail.net" target="_blank">konrad.hinsen@fastmail.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi everyone,<br>
<br>
I find myself writing lots of expressions such as<br>
<br>
(for/list ([temp some-sequence])<br>
(match temp [(list a b) a]))<br>
<br>
where I iterate over a sequence and then destructure each element of<br>
the sequence using match, most often to pick some fields out of<br>
a struct. Is there a more compact way to do this? Ideally I'd like<br>
to write<br>
<br>
(for/list ([(list a b) some-sequence])<br>
a)<br>
<br>
I could probably hack together a suitable macro, but I wonder if there's<br>
already an idiomatic way to handle this situation.<br>
<br>
Konrad.<br>
____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Jay McCarthy <<a href="mailto:jay@cs.byu.edu" target="_blank">jay@cs.byu.edu</a>><br>Assistant Professor / Brigham Young University<br><a href="http://faculty.cs.byu.edu/~jay" target="_blank">http://faculty.cs.byu.edu/~jay</a><br>
<br>"The glory of God is Intelligence" - D&C 93
</div>