⊂ — Enclose / Partitioned enclose
Function. Keys: Alt-z. Hanzi: 包. Ranks: ∞ monadic, 1 ∞ dyadic
⊂Y is a scalar holding Y.
A one-item bracket list, [Y], is a vector, not a scalar. ⊂ cannot enclose a function, because ⊂ next to a function forms a train. To enclose a function, write ᵘ after it. fᵘ is a scalar holding f.
⍴⊂1 2 3 ⍝ ⍬ₓ
↑⊂1 2 3 ⍝ 1 2 3
⊂3 ≡ 3 ⍝ $fWith axes, ⊂⍠K Y encloses cells on axes K.
⊂₁2 3⍴⍳6ₓ ⍝ [[0 1 2] [3 4 5]]ₓN⊂Y starts partitions at positive marks along the leading axis. Each partition is a block of major cells. Leading zero marks are ignored.
1 0 1 0⊂"abcd" ⍝ "ab" "cd"
1 0 1⊂3 2⍴⍳6ₓ ⍝ [[0 1⋄2 3] [4 5⋄]]ₓA mark greater than 1 starts extra empty partitions. Unit marks extend. N⊂⍠K Y partitions along axis K instead. N⊂⍤1 Y partitions each row.
1 0 1⊂₁2 3⍴⍳6ₓ ⍝ [[0 1⋄3 4] [[2]⋄[5]]]ₓ
1 0 1⊂⍤1 (2 3⍴⍳6ₓ) ⍝ [[0 1] [2]⋄[3 4] [5]]ₓSee also ⊆.
Inverse
⊂⁻Y is ↑Y. X⊂⁻Y joins the parts Y. Partitioning the result by X must give Y again, so X can’t drop leading items.
⊂⁻⊂1 2 ⍝ 1 2
1 0 1⊂⁻(1 2⋄3) ⍝ 1 2 3