1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-03-14 11:10:01 +01:00

rename param

This commit is contained in:
Justin Lin 2021-02-24 21:26:16 +08:00
parent e55422c479
commit 44733e7a9a
4 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -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);