feat: Enhance #use directive for directories and cwd
The `#use` directive now supports referencing entire directories, automatically including all `.myc` files within them. Additionally, environments are now initialized with the current working directory as a default search path, simplifying module resolution.
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
(do
|
||||
(def SMA
|
||||
(fn [length]
|
||||
(do
|
||||
(def history (series :float))
|
||||
(def sum 0.0)
|
||||
|
||||
(fn [val]
|
||||
(do
|
||||
(def hist_len (len history))
|
||||
(if (>= hist_len length)
|
||||
(assign sum (- sum (history (- length 1)))))
|
||||
|
||||
(push history val)
|
||||
(assign sum (+ sum val))
|
||||
|
||||
(if (>= hist_len length)
|
||||
(/ sum length))
|
||||
)))))
|
||||
)
|
||||
Reference in New Issue
Block a user