on ecfde25 help sign in
47 lines 970 B history raw
1### `++here`
3Place-based apply
5Parser modifier. Similar to `++cook` in that it produces a parser that takes a
6(successful) result of `sef` and slams it through `hez`. `hez` accepts a
7`++pint` `a` and a noun `b`, which is what the parser parsed.
9Accepts
10-------
12`hez` is a gate.
14`sef` is a `++rule`
16Produces
17--------
19A `++rule`.
21Source
22------
24 ++ here :: place-based apply
25 ~/ %here
26 |* {hez/_|=({a/pint b/*} [a b]) sef/rule}
27 ~/ %fun
28 |= tub/nail
29 =+ vex=(sef tub)
30 ?~ q.vex
31 vex
32 [p=p.vex q=[~ u=[p=(hez [p.tub p.q.u.q.vex] p.u.q.vex) q=q.u.q.vex]]]
33 ::
35Examples
36--------
38 ~zod/try=> (scan "abc" (star alf))
39 "abc"
40 ~zod/try=> (scan "abc" (here |*(^ +<) (star alf)))
41 [[[p=1 q=1] p=1 q=4] "abc"]
42 ~zod/try=> (scan "abc" (star (here |*(^ +<) alf)))
43 ~[[[[p=1 q=1] p=1 q=2] ~~a] [[[p=1 q=2] p=1 q=3] ~~b] [[[p=1 q=3] p=1 q=4] ~~c]]
47***