anonymous-lambda-1.scm 252 B

1234567
  1. (module-extends <pair>)
  2. (define lst1 (let ((x 1)) (list x (lambda (exp) (* 2 exp)))))
  3. (define lst2 (let ((x 2)) (list x (lambda (exp) (* 3 exp)))))
  4. (format #t "result: ~s ~s~%" ((cadr lst1) (car lst1)) ((cadr lst2) (car lst2)))
  5. ;; Output: result: 2 6