I originally wrote thunk* for cases like the callback initialization argument of button%. It expects a function of two arguments that performs an effect, but I don't think I've ever used either argument in the function's body. Rather than writing (lambda (x y) e ...) with x and y never used, I prefer to write (thunk* e ...) which makes it explicit that any arguments are irrelevant and avoids binding unused names.
--Carl On Sun, May 13, 2012 at 1:24 AM, Jay McCarthy <jay.mccar...@gmail.com>wrote: > Sorry, I was crazy. My local doc build was busted, so it didn't show up. > > I've never used thunk* but I presume that it's designed for when you > want to have the procedure as an argument to something like map, > without trying to be arity-polymorphic yourself (which is very > cumbersome for keyword procedures.) > > Jay > > On Sat, May 12, 2012 at 11:07 PM, Harry Spier <vasishtha.sp...@gmail.com> > wrote: > > Section 3.17 Procedures in the Racket Reference manual (my local > > version with the latest Racket windows version > > > > On 5/13/12, Jay McCarthy <jay.mccar...@gmail.com> wrote: > >> I may be crazy, but I can't find any documentation for thunk or > >> thunk*. Can you tell me where you are finding these forms, so I can > >> see what they do and thus how they might be useful? > >> > >> Jay >
____________________ Racket Users list: http://lists.racket-lang.org/users