mirror of
https://github.com/janet-lang/janet
synced 2025-02-27 13:20:02 +00:00
commit
f7ca6deeb0
@ -3148,8 +3148,10 @@
|
|||||||
(defn net/close "Alias for ev/close." [stream] (ev/close stream))
|
(defn net/close "Alias for ev/close." [stream] (ev/close stream))
|
||||||
|
|
||||||
(defn ev/call
|
(defn ev/call
|
||||||
"Call a function asynchronously. Returns a fiber that is scheduled to "
|
```
|
||||||
"run the function."
|
Call a function asynchronously.
|
||||||
|
Returns a fiber that is scheduled to run the function.
|
||||||
|
```
|
||||||
[f & args]
|
[f & args]
|
||||||
(ev/go (fiber/new (fn [&] (f ;args)) :tp)))
|
(ev/go (fiber/new (fn [&] (f ;args)) :tp)))
|
||||||
|
|
||||||
@ -3291,7 +3293,7 @@
|
|||||||
(if-let [jp (getenv-alias "JANET_PATH")] (setdyn :syspath jp))
|
(if-let [jp (getenv-alias "JANET_PATH")] (setdyn :syspath jp))
|
||||||
(if-let [jp (getenv-alias "JANET_HEADERPATH")] (setdyn :headerpath jp))
|
(if-let [jp (getenv-alias "JANET_HEADERPATH")] (setdyn :headerpath jp))
|
||||||
(if-let [jprofile (getenv-alias "JANET_PROFILE")] (setdyn :profilepath jprofile))
|
(if-let [jprofile (getenv-alias "JANET_PROFILE")] (setdyn :profilepath jprofile))
|
||||||
|
|
||||||
# Flag handlers
|
# Flag handlers
|
||||||
(def handlers
|
(def handlers
|
||||||
{"h" (fn [&]
|
{"h" (fn [&]
|
||||||
@ -3382,7 +3384,7 @@
|
|||||||
(file/flush stdout)
|
(file/flush stdout)
|
||||||
(file/read stdin :line buf))
|
(file/read stdin :line buf))
|
||||||
(def env (make-env))
|
(def env (make-env))
|
||||||
(when-let [profile.janet (dyn :profilepath)]
|
(when-let [profile.janet (dyn :profilepath)]
|
||||||
(def new-env (dofile profile.janet :exit true))
|
(def new-env (dofile profile.janet :exit true))
|
||||||
(merge-module env new-env "" false))
|
(merge-module env new-env "" false))
|
||||||
(if *debug* (put env :debug true))
|
(if *debug* (put env :debug true))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user