[racket] future

From: Hendrik Boom (hendrik at topoi.pooq.com)
Date: Mon Aug 29 21:20:47 EDT 2011

On Mon, Aug 29, 2011 at 08:58:08PM -0400, Carl Eastlund wrote:
> On Mon, Aug 29, 2011 at 7:20 PM, Robby Findler
> <robby at eecs.northwestern.edu> wrote:
> > Oh, another thought: I seem to recall a macro-writer rule of thumb:
> > "don't use a macro just to thunkify some argument". Is that a bad
> > memory on my part? Or does that not apply here somehow?
> >
> > (BTW, I don't really feel very negative about this; I think it is a
> > good change overall.)
> >
> > Robby
> 
> I've heard that guideline before and never liked it.  Why not use a
> macro just to thunkify some argument?  Seems like a good use of a
> macro to me.  The purpose of "future" isn't to call a thunk later,
> it's to evaluate an expression later.  Thunks are just an
> implementation detail, one that the proposed macro nicely abstracts
> away.  Ditto for pretty much every "thunkify some argument" macro I
> can think of.

the only reason I can think of for this rule is that the user might want
to code his thunks explicitly.  But if that kind of rule were followed 
slavishly we'd have to write

(if a (lambda() 3) (lambda() 4))

instead of

(if a 3 4)


-- hendrik

> 
> --Carl
> _________________________________________________
>   For list-related administrative tasks:
>   http://lists.racket-lang.org/listinfo/users


Posted on the users mailing list.