inline6.scm 485 B

12345678910111213141516
  1. ;; https://gitlab.com/kashell/Kawa/issues/33
  2. ;; Odd closure issue with cond and =>
  3. (define procs
  4. (map (lambda (arg)
  5. (! m (memq arg '(a b c)))
  6. (if m
  7. (lambda () (format #t "tail is ~A~%" m)) ; cl$frame.lambda1
  8. (lambda () (format #t "~A not found.~%" arg)))) ; cl$frame.lambda2
  9. '(b c d a)))
  10. ((dynamic for-each) (lambda (f) (f)) procs)
  11. ;; Output: tail is (b c)
  12. ;; Output: tail is (c)
  13. ;; Output: d not found.
  14. ;; Output: tail is (a b c)