1
0
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:
Justin Lin
2021-03-06 10:01:41 +08:00
parent 1cd2af5760
commit e27759e8ed
3 changed files with 0 additions and 14 deletions

View File

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

View File

@@ -1,3 +0,0 @@
function assoc_lookup(array, key) =
let(idx = search([key], array)[0])
array[idx][1];

View File

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