@@ -4,94 +4,93 @@ navhome: /docs/
6# 4d: parsing (tracing)
6# 4d: parsing (tracing)
9−Farther trace
8+### `last`
11−Compares two line-column pairs, called `++hair`s, `zyc` and `naz`, producing whichever
10+Further trace
14−Accepts
12+Compares two line-column pairs, `zyc` and `naz`, producing
15−-------
13+whichever is further along.
17−`naz` is a hair.
15+#### Accepts
19−`zyc` is a hair.
17+`naz` is a `hair`.
21−Produces
19+`zyc` is a `hair`.
24−a `++hair`.
21+#### Produces
29− ++ last |= {zyc/hair naz/hair} :: farther trace
27+ ++ last |= [zyc=hair naz=hair]
31 ?: =(p.zyc p.naz)
29 ?: =(p.zyc p.naz)
32 ?:((gth q.zyc q.naz) zyc naz)
30 ?:((gth q.zyc q.naz) zyc naz)
33 ?:((gth p.zyc p.naz) zyc naz)
31 ?:((gth p.zyc p.naz) zyc naz)
36−Examples
34+#### Examples
39 > (last [1 1] [1 2])
36 > (last [1 1] [1 2])
41 > (last [2 1] [1 2])
39 > (last [2 1] [1 2])
43 > (last [0 0] [99 0])
42 > (last [0 0] [99 0])
44 [p=99 q=0]
43 [p=99 q=0]
45 > (last [7 7] [7 7])
45 > (last [7 7] [7 7])
51−### `++lust`
50+### `lust`
53Detect newline
52Detect newline
55−Advances the `++hair` `naz` by a row if the `++char` `weq` is a newline, or by a
54+Advances `naz` by a row if the `weq` is a newline, or by a column if `weq` is
56−column if `weq` is any other character.
55+any other character.
58−Accepts
57+#### Accepts
61−`weq` is a char.
59+`weq` is a `char`.
63−`naz` is a hair.
61+`naz` is a `hair`.
65−Produces
63+#### Produces
73− ++ lust |= {weq/char naz/hair} :: detect newline
69+ ++ lust |= [weq=char naz=hair]
75 ?:(=(`@`10 weq) [+(p.naz) 1] [p.naz +(q.naz)])
71 ?:(=(`@`10 weq) [+(p.naz) 1] [p.naz +(q.naz)])
79−Examples
75+#### Examples
82 > (lust `a` [1 1])
77 > (lust `a` [1 1])
84 > (lust `@t`10 [1 1])
80 > (lust `@t`10 [1 1])
86 > (lust '9' [10 10])
83 > (lust '9' [10 10])
87 [p=10 q=11]
84 [p=10 q=11]
88− /> (roll "maze" [.(+<+ [1 1])]:lust)
86+ > (roll "maze" [.(+<+ [1 1])]:lust)
90− /> %- roll :_ [.(+<+ [1 1])]:lust
89+ > %- roll :_ [.(+<+ [1 1])]:lust