sva43131.scm 471 B

123456789101112131415161718192021
  1. ;; Kawa-options: "--no-inline" "-f" %F
  2. ;; Based on Savannah bug #43131
  3. ;; "Poor support for re-defining toplevel variables", by Helmut Eller.
  4. (define (foo) 1)
  5. (define (bar i) (format #t "version ~d: ~s~%" i (foo)) (force-output))
  6. (bar 1)
  7. ;; Output: version 1: 1
  8. (define (foo) 2)
  9. (bar 2)
  10. ;; Output: version 2: 2
  11. (define foo (lambda () 3))
  12. (bar 3)
  13. ;; Output: version 3: 3
  14. (define (foo) 4)
  15. (bar 4)
  16. ;; Output: version 4: 4
  17. (define (foo) 5)
  18. (bar 5)
  19. ;; Output: version 5: 5