;; Notes from another session (setq mul (lambda (x) (lambda (y) (* x y)))) (closure (t) (x) #'(lambda (y) (* x y))) (funcall (funcall mul 3) 5) 15 (funcall mul 3) (closure ((x . 3) t) (y) (* x y)) (disassemble-internal mul 2 nil) doc: ... args: (arg1) ; [arg1] 0 constant make-closure ; [make-closure arg1] 1 constant ; [ make-closure arg1] doc: ... args: (arg1) ; new stack [arg1] 0 constant V0 ; [V0 arg1] 1 stack-ref 1 ; [arg1 V0 arg1] 2 mult ; [arg1*V0 arg1] 3 return 2 stack-ref 2 ; [arg1 [ make-closure arg1] 3 call 2 ; [ arg1] 4 return nil (setq xyzsn (lambda (x) (let ((y 1)) (lambda (z) (let ((n 1)) (lambda (s) (* x y z s n))))))) (closure (t) (x) (let ((y 1)) #'(lambda ... ...))) (pp xyzsn) (closure (t) (x) (let ((y 1)) #'(lambda (z) (let ((n 1)) #'(lambda (s) (* x y z s n)))))) (disassemble-internal (lambda (x) (let ((y 1)) (lambda (z) (let ((n 1)) (lambda (s) (* x y z s n)))))) 2 nil) doc: ... args: (arg1) 0 constant 1 1 constant make-closure 2 constant doc: ... args: (arg1) 0 constant 1 1 constant make-closure 2 constant doc: ... args: (arg1) 0 constant * 1 constant V0 2 constant V1 3 constant V2 4 stack-ref 4 5 constant V3 6 call 5 7 return 3 constant V0 4 constant V1 5 stack-ref 5 6 stack-ref 5 7 call 5 8 return 3 stack-ref 3 4 stack-ref 3 5 call 3 6 return nil