Does that mean that lambda expressions have an implicit (begin …) block in them?

(begin ((displayln 1) (displayln 2) (displayln 3))) leads to an error

(begin . ((displayln 1) (displayln 2) (displayln 3))) displays to 1 2 3

Thank you for the detailed explanation I think I get it now.

> On 13 Mar 2016, at 19:48, Jens Axel Søgaard <[email protected] 
> <mailto:[email protected]>> wrote:
> 
> If we use
> 
> (define-syntax define/memoized
>   (syntax-rules ()
>     ((_ (name . args) . body)
>      (define name (memoize (lambda args  body))))))
> 
> and body is bound to    ((displayln x) (displayln y) (displayz)) 
> then
> 
>     (lambda args  body)
> 
> will become
> 
>     (lambda <something> ((displayln x) (displayln y) (displayz)))
> 
> And when this function is called you will get an error since
> 
>     ((displayln x) ...) 
> 
> means apply the result of (displayln x) to (displayln y) (displayln x).
> 
> /Jens Axel

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to