> Date: Wed, 2 Dec 2020 11:34:32 -0500
> From: Nicholas Papadonis <nick.papadonis...@gmail.com>
> 
> Does function application and variable binding not appear in (pp <>)
> output?  I'm trying to understand why (lambda (c))'s variables are not
> bound.  Thanks
> 
> (define-syntax curry
>   (syntax-rules ()
>     ((_ (a) body ...)
>      (lambda (a) body ...))
>     ((_ (a b ...) body ...)
>      (lambda (a) (curry (b ...) body ...)))))
> 
> ((((curry (a b c) (+ a b c)) 1) 1) 1)
> ;Value: 3
> 
> (pp (((curry (a b c) (+ a b c)) 1) 1))
> (lambda (c)
>   (+ a b c))
> ;Unspecified return value

pp doesn't perform any substitution in the display.  You can see that
it's exactly the same lambda as appears in the text of:

(pp (curry (a b c) (+ a b c)))
(lambda (a)
  (lambda (b)
    (lambda (c)
      (+ a b c))))
;Unspecified return value

You can, however, browse the environment of the closure -- try running
(where (((curry (a b c) (+ a b c)) 1) 1)) and typing `a' to print all
the bindings in the environment.

Reply via email to