on 492ae2f help sign in
40 lines 686 B history raw
1### `++skid`
3Separate
5Separates a `++list` `a` into two lists - Those elements of `a` who produce
6true when slammed to gate `b` and those who produce `%.n`.
8Accepts
9-------
11`b` is a gate that accepts one argument and produces a loobean.
13Produces
14--------
16A cell of two lists.
18Source
19------
21 ++ skid :: separate
22 ~/ %skid
23 |* {a/(list) b/$-(* ?)}
24 |- ^+ [p=a q=a]
25 ?~ a [~ ~]
26 =+ c=$(a t.a)
27 ?:((b i.a) [[i.a p.c] q.c] [p.c [i.a q.c]])
31Examples
32--------
34 ~zod/try=> =a |=(a/@ (gth a 1))
35 ~zod/try=> (skid (limo [0 1 2 3 ~]) a)
36 [p=[i=2 t=[i=3 t=~]] q=[i=0 t=[i=1 t=~]]]
40***