You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.0 KiB
39 lines
1.0 KiB
1 year ago
|
struct::list::Lfilter {a apple b aardvark c} {
|
||
|
@@ok/result.= {
|
||
|
pipeswitch {
|
||
|
puts "c0: [string range $switchargs 0 0]"
|
||
|
pipecase .= ,'a'.= string range $switchargs 0 0 |> {val 1}
|
||
|
val {ok {result 0}}
|
||
|
} $in
|
||
|
} |> {puts $data; set data} <in|
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
pipeset pipeb @@ok/result.= {
|
||
|
pipeswitch {
|
||
|
pipecase .= ,'b'.= string range $switchargs 0 0 |> {val 1}
|
||
|
val {ok {result 0}}
|
||
|
} $in
|
||
|
} <in|
|
||
|
|
||
|
|
||
|
puts stdout [struct::list::Lfilter {a apple b aardvark banana blah c} $pipeb]
|
||
|
|
||
|
|
||
|
pipeset pipec @@ok/result.=in/end \
|
||
|
pipeswitch {
|
||
|
pipecase .= ,'c'.= string range $switchargs 0 0 |> {val 1}
|
||
|
val {ok {result 0}}
|
||
|
} <in|
|
||
|
|
||
|
|
||
|
puts stdout [struct::list::Lfilter {a apple b aardvark banana blah c charlie chocolate} $pipec]
|
||
|
|
||
|
|
||
|
|
||
|
#>f . reduce {.=* list |> {join $data ":"} <|} {a b c d e f}
|
||
|
|
||
|
|
||
|
|