1
0
mirror of https://github.com/janet-lang/janet synced 2024-06-23 13:43:16 +00:00

Add sum and product functions to boot.dst.

This commit is contained in:
Calvin Rose 2018-05-26 14:21:49 -04:00
parent 8a346ec655
commit 3b30b98ec0

View File

@ -102,6 +102,9 @@
})
(fn [x] (not (get non-atomic-types (type x))))))
(defn sum [xs] (apply1 + xs))
(defn product [xs] (apply1 * xs))
# C style macros and functions for imperative sugar
(defn inc [x] (+ x 1))
(defn dec [x] (- x 1))