1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-01-19 07:08:04 +01:00
This commit is contained in:
Justin Lin 2021-02-10 08:42:30 +08:00
parent cddfde26f4
commit 1767fc5ba8
3 changed files with 28 additions and 0 deletions

View File

@ -146,6 +146,7 @@ These examples incubate dotSCAD and dotSCAD refactors these examples. See [examp
- [util/rand](https://openhome.cc/eGossip/OpenSCAD/lib2x-rand.html)
- [util/reverse](https://openhome.cc/eGossip/OpenSCAD/lib2x-reverse.html)
- [util/slice](https://openhome.cc/eGossip/OpenSCAD/lib2x-slice.html)
- [util/some](https://openhome.cc/eGossip/OpenSCAD/lib3x-some.html)
- [util/sort](https://openhome.cc/eGossip/OpenSCAD/lib3x-sort.html)
- [util/sub_str](https://openhome.cc/eGossip/OpenSCAD/lib2x-sub_str.html)
- [util/split_str](https://openhome.cc/eGossip/OpenSCAD/lib2x-split_str.html)

17
docs/lib3x-some.md Normal file
View File

@ -0,0 +1,17 @@
# some
The `some` function tests whether at least one element in the list passes the test implemented by the provided function.
**Since:** 3.0
## Parameters
- `lt` : the list.
- `test` : a test function that accepts an element and returns `true` or `false`.
## Examples
use <util/some.scad>;
isOdd = function(elem) elem % 2 == 1;
assert(some([1, 30, 39, 29, 10, 13], isOdd));

View File

@ -1,3 +1,13 @@
/**
* some.scad
*
* @copyright Justin Lin, 2021
* @license https://opensource.org/licenses/lgpl-3.0.html
*
* @see https://openhome.cc/eGossip/OpenSCAD/lib3x-some.html
*
**/
use <_impl/_some.scad>;
function some(lt, test) = _some(lt, test, len(lt));