mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-03-14 11:10:01 +01:00
rename param
This commit is contained in:
parent
e55422c479
commit
44733e7a9a
@ -7,7 +7,7 @@ Make a list that aggregates elements from each of the lists. Returns a list of l
|
||||
## Parameters
|
||||
|
||||
- `lts` : A list of lists.
|
||||
- `slider` : Rather than listing the elements, the elements are combined using the function. **Since:** 3.0
|
||||
- `combine` : Rather than listing the elements, the elements are combined using the function. **Since:** 3.0
|
||||
|
||||
## Examples
|
||||
|
||||
|
@ -11,7 +11,7 @@ dotSCAD 3.0 Dev
|
||||
- `util/sort`: `by` accepts a function literal.
|
||||
- `util/bsearch`: only supports `sorted` and `target` parameters. I view it as a new function.
|
||||
- `util/dedup`: add the `eq` parameter.
|
||||
- `util/zip`: add the `head` parameter.
|
||||
- `util/zip`: add the `combine` parameter.
|
||||
|
||||
New modules/functions
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
_identity = function(elems) elems;
|
||||
|
||||
function _zipAll_sub(lts, list_to, elem_to, slider, i = 0) =
|
||||
function _zipAll_sub(lts, list_to, elem_to, combine, i = 0) =
|
||||
i > elem_to ? [] :
|
||||
concat([slider([for(j = [0:list_to]) lts[j][i]])], _zipAll_sub(lts, list_to, elem_to, slider, i + 1));
|
||||
concat([combine([for(j = [0:list_to]) lts[j][i]])], _zipAll_sub(lts, list_to, elem_to, combine, i + 1));
|
||||
|
||||
function _zipAll(lts, slider = _identity) = _zipAll_sub(lts, len(lts) - 1, len(lts[0]) - 1, slider);
|
||||
function _zipAll(lts, combine = _identity) = _zipAll_sub(lts, len(lts) - 1, len(lts[0]) - 1, combine);
|
@ -10,4 +10,4 @@
|
||||
|
||||
use <_impl/_zip_impl.scad>;
|
||||
|
||||
function zip(lts, slider) = is_function(slider) ? _zipAll(lts, slider) : _zipAll(lts);
|
||||
function zip(lts, combine) = is_function(combine) ? _zipAll(lts, combine) : _zipAll(lts);
|
Loading…
x
Reference in New Issue
Block a user