on 492ae2f help sign in
50 lines 734 B history raw
1### `++mas`
3Axis within head/tail?
5Computes the axis of `a` within either the head or tail of a noun (depends whether `a` lies within the the head or tail).
7Accepts
8-------
10`a` is an [atom]().
12Produces
13--------
15An atom.
17Source
18------
20 ++ mas :: tree body
21 ~/ %mas
22 |= a=@
23 ^- @
24 ?- a
25 1 !!
26 2 1
27 3 1
28 * (add (mod a 2) (mul $(a (div a 2)) 2))
29 ==
30 ::
32Examples
33--------
35 ~zod/try=> (mas 3)
36 1
37 ~zod/try=> (mas 4)
38 2
39 ~zod/try=> (mas 5)
40 3
41 ~zod/try=> (mas 6)
42 2
43 ~zod/try=> (mas 0)
44 ! exit
45 ~zod/try=> (mas 1)
46 ! exit
50***