[racket] Using Futures

From: The Configurator (configurator at gmail.com)
Date: Wed Jul 28 17:16:12 EDT 2010

Nothing about futures here either, but shouldn't the sum of the list be kept
aside it somehow? You're recalculating the sum of the selected values many
many times here.

On Wed, Jul 28, 2010 at 21:44, Matthias Felleisen <matthias at ccs.neu.edu>wrote:

>
> (Nothing about futures. But may I recommend a nice and simple
> 'optimization':
>
>  (cond
>    [(= 1 (length values)) ...]
>
> adds quite some complexity to a recursive function over a list.
> I'd use
>
>  (empty? (rest values))
>
> instead.
>
> Also, I assume that you will protect your function with a
> contract or a main function.
>
> -- Matthias)
>
>
>
> On Jul 28, 2010, at 4:35 PM, Joe Snikeris wrote:
>
> > All,
> >
> > Please see: http://pastie.org/1064484
> >
> > Apparently, spawning futures recursively is a bad idea.  This problem
> > seems like it should be easily parallelizable.  What am I doing wrong
> > here?
> >
> > Thanks,
> > Joe
> > _________________________________________________
> >  For list-related administrative tasks:
> >  http://lists.racket-lang.org/listinfo/users
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20100728/d40a4ba2/attachment.html>

Posted on the users mailing list.