on 5e6a67f help sign in
39 lines 459 B history raw
1### `++add`
3Add
5Produces the sum of `a` and `b`.
7Accepts
8-------
10`a` is an atom.
12`b` is an atom.
14Produces
15--------
17An atom.
19Source
20------
22 ++ add :: add
23 ~/ %add
24 |= [a=@ b=@]
25 ^- @
26 ?: =(0 a) b
27 $(a (dec a), b +(b))
29Examples
30--------
32 ~zod/try=> (add 2 2)
33 4
34 ~zod/try=> (add 1 1.000.000)
35 1.000.001
36 ~zod/try=> (add 1.333 (mul 2 2))
37 1.337
39***