03-code.scm 357 B

1234567891011121314151617181920212223242526
  1. (import
  2. (except (rnrs base) let-values map error)
  3. (only (guile)
  4. lambda* λ
  5. current-output-port
  6. simple-format)
  7. (srfi srfi-1))
  8. ;;; Exercise 3.1
  9. (simple-format
  10. #t "~a\n"
  11. (let* ([x 6]
  12. [y (* x x)])
  13. (+ x y)))
  14. ;; This should be equivalent to:
  15. (simple-format
  16. #t "~a\n"
  17. ((λ (x)
  18. ((λ (y) (+ x y))
  19. (* x x)))
  20. 6))