1
0
mirror of https://github.com/janet-lang/janet synced 2025-12-11 19:18:07 +00:00

Many changes for adding dynamic (fiber-level) scope.

- Allow passing a table to fibers, which make fiber level scope easier.
- Add fiber/getenv, fiber/setenv, dyn, and setdyn
- Remove meta, *env*, and *doc-width*
- Some functions changed dignatures, and no longer take an env
This commit is contained in:
Calvin Rose
2019-04-16 15:41:45 -04:00
parent 7527142549
commit 2d7df6b78e
13 changed files with 149 additions and 71 deletions

View File

@@ -46,7 +46,7 @@
3)
"-" (fn [&] (set *handleopts* false) 1)
"l" (fn [i &]
(import* *env* (get process/args (+ i 1))
(import* (get process/args (+ i 1))
:prefix "" :exit *exit-on-error*)
2)
"e" (fn [i &]
@@ -67,7 +67,7 @@
(+= i (dohandler (string/slice arg 1 2) i))
(do
(set *no-file* false)
(import* *env* arg :prefix "" :exit *exit-on-error*)
(import* arg :prefix "" :exit *exit-on-error*)
(set i lenargs))))
(when (or *should-repl* *no-file*)
@@ -86,4 +86,5 @@
(defn getchunk [buf p]
(getter (prompter p) buf))
(def onsig (if *quiet* (fn [x &] x) nil))
(repl getchunk onsig (if *colorize* "%.20P" "%.20p"))))
(setdyn :pretty-format (if *colorize* "%.20P" "%.20p"))
(repl getchunk onsig)))