mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-12 09:44:16 +02:00
refactor
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
function _sub_str(t, begin, end) =
|
||||
begin == end ? "" : str(t[begin], _sub_str_impl(t, begin + 1, end));
|
||||
|
||||
function _sub_str_impl(t, begin, end) =
|
||||
is_undef(end) ? _sub_str(t, begin, len(t)) : _sub_str(t, begin, end);
|
@@ -8,6 +8,9 @@
|
||||
*
|
||||
**/
|
||||
|
||||
use <_impl/_sub_str_impl.scad>;
|
||||
|
||||
function sub_str(t, begin, end) = _sub_str_impl(t, begin, end);
|
||||
function sub_str(t, begin, end) =
|
||||
let(
|
||||
ed = is_undef(end) ? len(t) : end,
|
||||
cum = [for(i = begin, s = t[i]; i < ed; i = i + 1, s = str(s, t[i])) s]
|
||||
)
|
||||
cum[len(cum) - 1];
|
Reference in New Issue
Block a user