testoutput.scm 2.2 KB

123456789101112131415161718192021222324
  1. scheme@(guile-user)> (add-to-load-path ".")
  2. scheme@(guile-user)> (load "macros/testfile.scm")
  3. scheme@(guile-user)> (replace-result-placeholder result (lambda (a) (+ a 1)))
  4. $3 = (replace-result-placeholder result (lambda (+ a 1) (list (replace-result-placeholder result (a)))))
  5. scheme@(guile-user)> ;; the first argument moved to the list -- OK!
  6. scheme@(guile-user)> (replace-result-placeholder result (lambda (+ a 1) (list (replace-result-placeholder result (a)))))
  7. $4 = (replace-result-placeholder result (lambda (list (replace-result-placeholder result (a)) (replace-result-placeholder result (+ a 1)))))
  8. scheme@(guile-user)> ;; second argument (argument list) moved to the list of transformed expression -- OK!
  9. scheme@(guile-user)> (replace-result-placeholder result (lambda (list (replace-result-placeholder result (a)) (replace-result-placeholder result (+ a 1)))))
  10. $5 = ((replace-result-placeholder result lambda) (replace-result-placeholder result (a)) (replace-result-placeholder result (+ a 1)))
  11. scheme@(guile-user)> ;; lambda was transformed as well! -- OK!
  12. scheme@(guile-user)> `(,(replace-result-placeholder result lambda) ,(replace-result-placeholder result (a)) ,(replace-result-placeholder result (+ a 1)))
  13. $6 = (lambda (a) (replace-result-placeholder result (+ 1 (list (replace-result-placeholder result a)))))
  14. scheme@(guile-user)> ;; OK now it looks at the body
  15. scheme@(guile-user)> `(lambda (a) ,(replace-result-placeholder result (+ 1 (list (replace-result-placeholder result a)))))
  16. $7 = (lambda (a) (replace-result-placeholder result (+ (list (replace-result-placeholder result a) (replace-result-placeholder result 1)))))
  17. scheme@(guile-user)> `(lambda (a) ,(replace-result-placeholder result (+ (list (replace-result-placeholder result a) (replace-result-placeholder result 1)))))
  18. $8 = (lambda (a) ((replace-result-placeholder result +) (replace-result-placeholder result a) (replace-result-placeholder result 1)))
  19. scheme@(guile-user)> ;; all parts of (+ a 1) transformed! -- OK
  20. scheme@(guile-user)> `(lambda (a) (,(replace-result-placeholder result +) ,(replace-result-placeholder result a) ,(replace-result-placeholder result 1)))
  21. $9 = (lambda (a) (+ a 1))
  22. scheme@(guile-user)> ;; All OK!
  23. scheme@(guile-user)>