[racket] Is there a name for: (lambda (x) (x)) ?

From: Justin Zamora (justin at zamora.com)
Date: Thu Sep 23 12:09:30 EDT 2010

Depending on why you're using thunks, you could replace them with promises:

(map force
 (list
   (delay 1)
   (delay 2)
   (delay 3))) => '(1 2 3)

Justin

On Thu, Sep 23, 2010 at 8:35 AM, Tim Brown <tim.brown at cityc.co.uk> wrote:
> Folks,
>
> Am I missing something really basic here?
>
> I have a list of thunks. I want to iterate over the results of these
> using a high-order function ... map, for-each, filter (et al).
>
> The only way I can find to do it is:
>
> (map (lambda (x) (x))
>  (list
>    (lambda () 1)
>    (lambda () 2)
>    (lambda () 3))) -> '(1 2 3)
>
> Is there a standard name for the (lambda (x) (x)) in racket?
>
> Or do I have to write my own (define (call x) (x))?
>
> Tim
>
> --
> Tim Brown <tim.brown at cityc.co.uk>  | City Computing Limited            |
> T: +44 20 8770 2110                | City House, Sutton Park Road      |
> F: +44 20 8770 2130                | Sutton, Surrey, SM1 2AE, GB       |
> -----------------------------------------------------------------------|
> BEAUTY:  What's in your eye when you have a bee in your hand           |
> -----------------------------------------------------------------------'
> City Computing Limited registered in London No. 1767817.
> Registered Office: City House, Sutton Park Road, Sutton, Surrey, SM1 2AE
> VAT number 372 8290 34.
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users
>


Posted on the users mailing list.