Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: keyed lists #49

Open
Lucretiel opened this issue Oct 7, 2022 · 1 comment
Open

Feature request: keyed lists #49

Lucretiel opened this issue Oct 7, 2022 · 1 comment

Comments

@Lucretiel
Copy link

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
@bbodi
Copy link
Owner

bbodi commented Oct 8, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants