Origin
Synced from Notion: LAMBDA: MAPCOLS / MAPROWS
Problem
Applying a function to specific columns (or rows) of an array — transforming them in place, or deriving new ones — has no single clean primitive. The competitor workbook ("Collecting Scarves") solved it with two unrelated wrappers: BSC / _bySpecificCols (in-place) and _hstackFnc (append derived columns). They share no name stem, so finding one never surfaces the other. We want one discoverable, orientation-symmetric pair.
Proposed
=MAPCOLS(array, cols, fnc, [placement], [keep_source])
=MAPROWS(array, rows, fnc, [placement], [keep_source])
Built on the existing BICOL / BIROW engine — these are just selection + placement layers, no new engine required.
- cols / rows — index list of columns/rows to transform; negative = counted from the end
- fnc — function applied to each selected column/row
- placement — 0 = in place (default) · 1 = append at right/bottom · -1 = prepend
- keep_source — when the result lands in a new position, keep the original column (default) or drop it
Notes
- Subsumes competitor
BSC (placement 0) and _hstackFnc (placement 1, keep/drop via keep_source).
- Unlocks a capability neither competitor wrapper had: in-place column expansion — splice multiple result columns back at the original position.
- Open design choice: a single public
MAPCOLS with a placement arg (preferred — fewer public names) vs. a discoverable pair. Either way keep a shared stem so intellisense pairs them.
Origin
Synced from Notion: LAMBDA: MAPCOLS / MAPROWS
Problem
Applying a function to specific columns (or rows) of an array — transforming them in place, or deriving new ones — has no single clean primitive. The competitor workbook ("Collecting Scarves") solved it with two unrelated wrappers:
BSC/_bySpecificCols(in-place) and_hstackFnc(append derived columns). They share no name stem, so finding one never surfaces the other. We want one discoverable, orientation-symmetric pair.Proposed
Built on the existing
BICOL/BIROWengine — these are just selection + placement layers, no new engine required.Notes
BSC(placement 0) and_hstackFnc(placement 1, keep/drop viakeep_source).MAPCOLSwith aplacementarg (preferred — fewer public names) vs. a discoverable pair. Either way keep a shared stem so intellisense pairs them.