From f001b0a40c57aa59c83a8e90317395ef681f76d8 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Mon, 13 Jan 2020 20:49:00 -0600 Subject: [PATCH] Update Changelog Also change how add-body in jpm works. We keep an array of thunks instead of a single thunk. --- CHANGELOG.md | 5 +++++ auxbin/jpm | 11 ++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00b80a93..2b154fd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/auxbin/jpm b/auxbin/jpm index 5d6e5c67..cd3d4f76 100755 --- a/auxbin/jpm +++ b/auxbin/jpm @@ -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)) #