[racket] reference #:when clause in for/list?

From: Sam Tobin-Hochstadt (samth at cs.indiana.edu)
Date: Sun Aug 17 07:59:13 EDT 2014

This is what 'in-value' is for.

Sam
On Aug 17, 2014 5:07 AM, "Mark Wallace" <lotabout at gmail.com> wrote:

> Consider the following pseudocode:
>
> (for/list ([i ...]
>            #:when <very complecated expr E>)
>   <reference to the above expr E>)
>
> Can I bind that expression E and reference in the body of "for/list"?
>
> If expression E takes lots of time to finish, we would not want to compute
> it again :).
>
> I understand that there are workarounds like first collect all items of
> expression E and then use 'filter' to get interested items. However it
> would be a waste of memory if the number of interested items is small.
>
> So, any ideas?
>
> --
> Best Regards,
> Mark Wallace.
> ____________________
>  Racket Users list:
>  http://lists.racket-lang.org/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140817/ca674fcd/attachment.html>

Posted on the users mailing list.