1
0
mirror of https://github.com/janet-lang/janet synced 2024-12-25 07:50:27 +00:00

Update Changelog

Also change how add-body in jpm works. We keep an array of thunks
instead of a single thunk.
This commit is contained in:
Calvin Rose 2020-01-13 20:49:00 -06:00
parent 04579664fd
commit f001b0a40c
2 changed files with 11 additions and 5 deletions

View File

@ -10,6 +10,11 @@ All notable changes to this project will be documented in this file.
- Remove Emscripten build. Instead, use the amalgamated source code with a custom toolchain.
- Update documentation.
- Add `module/add-paths`
- Add `file/temp`
- Small bug fixes
- Allow signaling from C functions (yielding) via janet\_signalv. This
makes it easy to write C functions that work with event loops, such as
in libuv or embedded in a game.
- Fix segfault regression when macros are called with bad arity.
### 1.6.0 - 2019-12-22

View File

@ -29,7 +29,7 @@
(defn- rule-impl
[target deps thunk &opt phony]
(put (getrules) target @[(array/slice deps) thunk phony]))
(put (getrules) target @[(array/slice deps) @[thunk] phony]))
(defmacro rule
"Add a rule to the rule graph."
@ -53,8 +53,9 @@
(defn- add-thunk
[target more]
(def item (gettarget target))
(def [_ thunk] item)
(put item 1 (fn [] (more) (thunk))))
(def [_ thunks] item)
(array/push thunks more)
item)
(defmacro add-body
"Add recipe code to an existing rule. This makes existing rules do more but
@ -83,10 +84,10 @@
(if (os/stat target :mode)
(break target)
(error (string "No rule for file " target " found."))))
(def [deps thunk phony] item)
(def [deps thunks phony] item)
(def realdeps (seq [dep :in deps :let [x (do-rule dep)] :when x] x))
(when (or phony (needs-build-some target realdeps))
(thunk))
(each thunk thunks (thunk)))
(unless phony target))
#