mirror of
https://github.com/janet-lang/janet
synced 2025-02-04 19:29:10 +00:00
Change default import prefix.
Changed from `(string path "/")` to `(string (last (string/split "/" path)) "/)`.
This commit is contained in:
parent
163e2a5b22
commit
689f2dcbb4
@ -2131,7 +2131,10 @@
|
||||
:prefix prefix
|
||||
:export ep} (table ;args))
|
||||
(def newenv (require path ;args))
|
||||
(def prefix (or (and as (string as "/")) prefix (string path "/")))
|
||||
(def prefix (or
|
||||
(and as (string as "/"))
|
||||
prefix
|
||||
(string (last (string/split "/" path)) "/")))
|
||||
(loop [[k v] :pairs newenv :when (symbol? k) :when (not (v :private))]
|
||||
(def newv (table/setproto @{:private (not ep)} v))
|
||||
(put env (symbol prefix k) newv)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user