Carp/examples/static_array.carp
2020-04-29 11:29:39 +02:00

5 lines
159 B
Plaintext

(defn main []
(let-do [xs $[1 2 3 4 5]]
(StaticArray.map! xs &(fn [x] (* @x 2)))
(println* (StaticArray.reduce &(fn [total x] (+ total @x)) 0 xs))))