mirror of
https://github.com/janet-lang/janet
synced 2025-01-23 13:46:52 +00:00
Add sum and product functions to boot.dst.
This commit is contained in:
parent
8a346ec655
commit
3b30b98ec0
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user