on bfaa358 help sign in
45 lines 552 B history raw
1### `++peg`
3Axis within axis
5Computes the axis of `b` within axis `a`.
7Accepts
8-------
10`a` is an atom.
12`b` is an atom.
14Produces
15--------
17An atom.
19Source
20------
22 ++ peg :: tree connect
23 ~/ %peg
24 |= {a/@ b/@}
25 ^- @
26 ?- b
27 $1 a
28 $2 (mul a 2)
29 $3 +((mul a 2))
30 * (add (mod b 2) (mul $(b (div b 2)) 2))
31 ==
33Examples
34--------
36 ~zod/try=> (peg 4 1)
37 4
38 ~zod/try=> (peg 4 2)
39 8
40 ~zod/try=> (peg 8 45)
41 269
45***