notecalc3 icon indicating copy to clipboard operation
notecalc3 copied to clipboard

Feature request: keyed lists

Open Lucretiel opened this issue 3 years ago • 1 comments

While it's possible to store collections of data in matrices, it would be nice if we could store collections into maps with keys. This allows for convenient aggregate operations:

item counts = [a: 1, b: 2, c: 3, d: 4]
weight per item = 10g

item weights = item counts * weight per item
item weights.d == 40g

Lucretiel avatar Oct 07 '22 19:10 Lucretiel

I can do this:

item weights = [1, 2, 3, 4] * 10g 
nth(item weights, 3)       

Unfortunately your exact request is out of scope and I don't think I will implement it, though I keep the issue open.

bbodi avatar Oct 08 '22 06:10 bbodi