1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-30 07:03:02 +00:00

Add with-syms and combine bignat_add and bignatr mul

into a single operation for strtod.c
This commit is contained in:
Calvin Rose
2019-01-02 10:23:11 -05:00
parent 0d4ab7dee0
commit 618f8d6818
2 changed files with 11 additions and 29 deletions

View File

@@ -652,6 +652,11 @@
(array/concat res (f x)))
res)
(defmacro with-syms
"Evaluates body with each symbol in syms bound to a generated, unique symbol."
[syms & body]
~(let ,(mapcat (fn [s] @[s (tuple gensym)]) syms) ,;body))
(defn filter
"Given a predicate, take only elements from an array or tuple for
which (pred element) is truthy. Returns a new array."