diff --git a/src/boot/boot.janet b/src/boot/boot.janet index e542b60a..cf311c12 100644 --- a/src/boot/boot.janet +++ b/src/boot/boot.janet @@ -149,10 +149,15 @@ (defmacro /= "Shorthand for (set x (/ x n))." [x n] ~(set ,x (,/ ,x ,n))) (defmacro %= "Shorthand for (set x (% x n))." [x n] ~(set ,x (,% ,x ,n))) -(defn assert - "Throw an error if x is not truthy." +(defmacro assert + "Throw an error if x is not truthy. Will not evaluate `err` if x is truthy." [x &opt err] - (if x x (error (if err err "assert failure")))) + (def v (gensym)) + ~(do + (def ,v ,x) + (if ,v + ,v + (,error ,(if err err "assert failure"))))) (defn errorf "A combination of error and string/format. Equivalent to (error (string/format fmt ;args))" diff --git a/src/conf/janetconf.h b/src/conf/janetconf.h index 9beb8657..8d0d7213 100644 --- a/src/conf/janetconf.h +++ b/src/conf/janetconf.h @@ -6,8 +6,8 @@ #define JANET_VERSION_MAJOR 1 #define JANET_VERSION_MINOR 17 #define JANET_VERSION_PATCH 0 -#define JANET_VERSION_EXTRA "dev" -#define JANET_VERSION "1.17.0-dev" +#define JANET_VERSION_EXTRA "" +#define JANET_VERSION "1.17.0" /* #define JANET_BUILD "local" */