mirror of
				https://github.com/janet-lang/janet
				synced 2025-10-30 23:23:07 +00:00 
			
		
		
		
	Change default import prefix.
Changed from `(string path "/")` to `(string (last (string/split "/" path)) "/)`.
This commit is contained in:
		| @@ -2131,7 +2131,10 @@ | |||||||
|         :prefix prefix |         :prefix prefix | ||||||
|         :export ep} (table ;args)) |         :export ep} (table ;args)) | ||||||
|   (def newenv (require path ;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))] |   (loop [[k v] :pairs newenv :when (symbol? k) :when (not (v :private))] | ||||||
|     (def newv (table/setproto @{:private (not ep)} v)) |     (def newv (table/setproto @{:private (not ep)} v)) | ||||||
|     (put env (symbol prefix k) newv))) |     (put env (symbol prefix k) newv))) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Calvin Rose
					Calvin Rose