inner-1.scm 943 B

1234567891011121314151617181920212223242526272829
  1. (eval '(define (foo) 'a))
  2. (eval '(define x foo))
  3. (eval '(let ((x (lambda () 'b)))
  4. (format #t "~w; ~w; ~w~%" (x) x (foo))))
  5. ;; Output: b; #<procedure x>; a
  6. ;; This simplified/hacked version of next-leaf-generator from test.scm
  7. ;; used to cause a VerifyError (due to a bug in setCallersNeedStaticLink
  8. ;; in LambdaExp.java).
  9. (define (next-leaf-generator1 eot)
  10. (letrec ((cont (lambda (x)
  11. (cond (x (list x eot))
  12. (else
  13. (set! cont
  14. (lambda (x) eot))
  15. (cont #t))))))
  16. (cont #f)))
  17. (format #t "lg1: ~a~%" (next-leaf-generator1 'eot))
  18. ;; Output: lg1: eot
  19. (define (next-leaf-generator2 eot)
  20. (letrec ((cont (lambda (x)
  21. (set! cont
  22. (lambda (x) eot))
  23. (cont #t))))
  24. (cont #f)))
  25. (format #t "lg2: ~a~%" (next-leaf-generator2 'eot))
  26. ;; Output: lg2: eot