>> a: [[1 2] "a" a [3 3]]
== [[1 2] "a" a [3 3]]
>> collect [foreach x a [if block? x [keep x]]]
== [1 2 3 3]
But what I want is [[1 2] [3 3]]. It seems that collect/keep would flat the result(in term of block). How to prevent it?
> collect [foreach x a [if block? x [keep x]]] == [1 2 3 3] But what I want is [[1 2] [3 3]]. It see" /> > collect [foreach x a [if block? x [keep x]]] == [1 2 3 3] But what I want is [[1 2] [3 3]]. It see" /> > collect [foreach x a [if block? x [keep x]]] == [1 2 3 3] But what I want is [[1 2] [3 3]]. It see"/>
Use
keep/only. FYI,keephas almost the same semantics asappend(barring a few refinements) with an implicit block thatcollectprovides internally: see?? collectfor the details.