include.zy 745 B

1234567891011121314151617181920212223242526272829303132
  1. // (println "Here in base ")
  2. // recursively sources inc1.g as well
  3. (source "./tests/inc.g")
  4. // (println "Calling function defined in inc.g")
  5. (assert (== (simple) "from include"))
  6. // (println "Calling function defined in inc1.g")
  7. (assert (== (simple1) "from include 1"))
  8. // (println (simple))
  9. // (println (simple1))
  10. // recursively includes inc3.g as well
  11. (include "./tests/inc2.g")
  12. (assert (== (inc2) "from inc2.g"))
  13. (assert (== (inc3) "from inc3.g"))
  14. // check that we are impacting the global env with our includes
  15. // and confirm that req macro works too. req is same as source
  16. // but uses a macro so you don't have to put double quotes around
  17. // the path.
  18. (def a 10)
  19. (source "tests/incr.g")
  20. (source "tests/incr.g")
  21. (assert (== a 12))