mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-12 01:34:12 +02:00
del assoc_xxx
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
use <util/slice.scad>;
|
||||
|
||||
function assoc_del(array, key) =
|
||||
let(idx = search([key], array)[0])
|
||||
idx == [] ? array : concat(slice(array, 0, idx), slice(array, idx + 1));
|
@@ -1,3 +0,0 @@
|
||||
function assoc_lookup(array, key) =
|
||||
let(idx = search([key], array)[0])
|
||||
array[idx][1];
|
@@ -1,6 +0,0 @@
|
||||
use <util/slice.scad>;
|
||||
|
||||
function assoc_put(array, key, value) =
|
||||
let(idx = search([key], array)[0])
|
||||
idx == [] ? concat(array, [[key, value]]) :
|
||||
concat(slice(array, 0, idx), [[key, value]], slice(array, idx + 1));
|
Reference in New Issue
Block a user