From 66054ae60310e346be12836be235700457cf8f3e Mon Sep 17 00:00:00 2001 From: Justin Lin Date: Thu, 11 Feb 2021 11:54:51 +0800 Subject: [PATCH] rename --- docs/lib3x-zip.md | 2 +- src/util/_impl/_zip_impl.scad | 6 +++--- src/util/zip.scad | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/lib3x-zip.md b/docs/lib3x-zip.md index 782acea5..39c0f496 100644 --- a/docs/lib3x-zip.md +++ b/docs/lib3x-zip.md @@ -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. -- `head` : Rather than listing the elements, the elements are combined using the function. **Since:** 3.0 +- `slider` : Rather than listing the elements, the elements are combined using the function. **Since:** 3.0 ## Examples diff --git a/src/util/_impl/_zip_impl.scad b/src/util/_impl/_zip_impl.scad index 753f9f4c..28cbc88b 100644 --- a/src/util/_impl/_zip_impl.scad +++ b/src/util/_impl/_zip_impl.scad @@ -1,7 +1,7 @@ _identity = function(elems) elems; -function _zipAll_sub(lts, list_to, elem_to, head, i = 0) = +function _zipAll_sub(lts, list_to, elem_to, slider, i = 0) = i > elem_to ? [] : - concat([head([for(j = [0:list_to]) lts[j][i]])], _zipAll_sub(lts, list_to, elem_to, head, i + 1)); + concat([slider([for(j = [0:list_to]) lts[j][i]])], _zipAll_sub(lts, list_to, elem_to, slider, i + 1)); -function _zipAll(lts, head = _identity) = _zipAll_sub(lts, len(lts) - 1, len(lts[0]) - 1, head); \ No newline at end of file +function _zipAll(lts, slider = _identity) = _zipAll_sub(lts, len(lts) - 1, len(lts[0]) - 1, slider); \ No newline at end of file diff --git a/src/util/zip.scad b/src/util/zip.scad index c91040ff..2430151d 100644 --- a/src/util/zip.scad +++ b/src/util/zip.scad @@ -10,4 +10,4 @@ use <_impl/_zip_impl.scad>; -function zip(lts, head) = is_function(head) ? _zipAll(lts, head) : _zipAll(lts); \ No newline at end of file +function zip(lts, slider) = is_function(slider) ? _zipAll(lts, slider) : _zipAll(lts); \ No newline at end of file