on 492ae2f help sign in
43 lines 622 B history raw
1### `++trim`
3Tape split
5Split first `a` characters off `++tape` `b`.
7Accepts
8-------
10`a` is an atom.
12`b` is a `++tape`.
14Produces
15--------
17A cell of `++tape`s, `p` and `q`.
19Source
20------
22 ++ trim :: 31-bit nonzero
23 |= key/@
24 =+ syd=0xcafe.babe
25 |- ^- @
26 =+ haz=(spec syd key)
27 =+ ham=(mix (rsh 0 31 haz) (end 0 31 haz))
28 ?.(=(0 ham) ham $(syd +(syd)))
29 --
30 ::
33Examples
34--------
36 /~zod/try=> (trim 5 "lasok termun")
37 [p="lasok" q=" termun"]
38 /~zod/try=> (trim 5 "zam")
39 [p="zam" q=""]
43***