Thanks everyone for the useful feedback. I'll check out all three options. :-)<br><br><div class="gmail_quote">On Fri, Mar 22, 2013 at 12:23 PM, Pierpaolo Bernardi <span dir="ltr"><<a href="mailto:olopierpa@gmail.com" target="_blank">olopierpa@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Thu, Mar 21, 2013 at 11:55 PM, Tim Nelson <<a href="mailto:tbnelson@gmail.com">tbnelson@gmail.com</a>> wrote:<br>
> Dear All,<br>
><br>
> I've recently started hacking Racket again, and am loving the for/*<br>
> constructs.<br>
> Awesome stuff. However, I have two questions about for/hash.<br>
><br>
> (1) How can I *not* add a hash entry for a given iteration?<br>
><br>
> When I use for/list, can I abuse the nature of empty and append* (I cringe<br>
> as I write this):<br>
><br>
> (append* (for/list ([i '(1 2 3 4 5)])<br>
> (cond [(even? i) (list (* i 100))]<br>
> [else empty])))<br>
><br>
> Surely there is a better way to do this for for/list, and a way in general<br>
> for for/hash?<br>
><br>
> (2) How can I add multiple entries (that is, >1 key-value pair) in a given<br>
> iteration?<br>
><br>
> Again, using for/list I can cheat via append*:<br>
><br>
> (append* (for/list ([i '(1 2 3 4 5)])<br>
> (list (* i 100) (* i 200))))<br>
><br>
> What's the right way to do this in for/hash?<br>
<br>
</div></div>To both of the questions, the answer is for/fold!<br>
<br>
Cheers<br>
<span class="HOEnZb"><font color="#888888">P.<br>
</font></span></blockquote></div><br>