Follow-up to #260 / #264.
The v1 MAPCOLS / MAPROWS pair ships with the same-length contract: fnc takes one column (or row) and must return a line of the same length. This keeps the implementation clean and fully testable by reusing the BICOL / BIROW engine directly.
The deferred capability
The original idea (#260) noted an unlock neither competitor wrapper had:
in-place column expansion — splice multiple result columns back at the original position.
i.e. allow fnc to return an m×k block for a selected column, and splice all k result columns back in at the source position (growing the array), rather than requiring k = 1.
Why it was deferred
- Variable per-line widths mean the result is no longer a fixed
m×nSel block, so BICOL can't be reused as-is.
- The scatter/merge step needs NA-padding +
TOCOL collapse tricks (see the combinatorial-generation note in the create-lambda skill) to assemble a ragged result into a rectangle.
- Harder to test and higher risk for the initial PR.
Acceptance
MAPCOLS(array, cols, fnc) where fnc returns m×k splices k columns back at each source position (placement 0), shifting later columns right.
- Append / prepend modes stack the (wider) result blocks.
- Symmetric behaviour for
MAPROWS (row expansion downward).
- Decide and document behaviour when different selected lines expand by different widths.
Follow-up to #260 / #264.
The v1 MAPCOLS / MAPROWS pair ships with the same-length contract:
fnctakes one column (or row) and must return a line of the same length. This keeps the implementation clean and fully testable by reusing theBICOL/BIROWengine directly.The deferred capability
The original idea (#260) noted an unlock neither competitor wrapper had:
i.e. allow
fncto return anm×kblock for a selected column, and splice allkresult columns back in at the source position (growing the array), rather than requiringk = 1.Why it was deferred
m×nSelblock, soBICOLcan't be reused as-is.TOCOLcollapse tricks (see the combinatorial-generation note in the create-lambda skill) to assemble a ragged result into a rectangle.Acceptance
MAPCOLS(array, cols, fnc)wherefncreturnsm×kspliceskcolumns back at each source position (placement 0), shifting later columns right.MAPROWS(row expansion downward).