~subsetpark/bagatto

ref: 22683bebdf00ea054405e41739fc0ef5fdeb7666 bagatto/src/env.janet -rw-r--r-- 491 bytes
22683beb — Zach Smith Demand pool management: wait for all threads to exit before main thread exits 10 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(import temple)

(defn prepare-env-with-bagatto! [bagatto]
  (temple/add-loader)
  (match (os/getenv "JANET_PATH")
    nil :ok
    janet-path (put root-env :syspath janet-path))
  (merge-into root-env bagatto))

(defn prepare-env-with-index! [env]
  # Monkey-patch the temple environment with the functions defined
  # in the index module.
  (merge-into temple/base-env env))

(defn prepare-environment!
  [bagatto env]
  (prepare-env-with-bagatto! bagatto)
  (prepare-env-with-index! env))