Dictu
Dictu copied to clipboard
[FEATURE] Set (initial) size of list, set, dict
Is there an existing issue for this?
- [X] I have searched the existing issues
Is your feature request related to a problem?
It might be helpful to have the ability to specify the initial size of list, set, and dict. A user would set the initial size of the type but wouldn't prevent them from further extension.
Describe the solution you'd like
var dozen = newList(12);
var daysOfTheWeek = newDict(7);
Describe alternatives you've considered
No response
Additional context
No response
Sounds good to me! I wonder if it's worth having a List / Dict namespace then later on we can add other methods that create these from method calls, i.e:
List.new(<number>);
Dict.new(<Number>);
List.fill(...)
Dict.from([["key", "value"], [...]])
I was thinking of doing that initially but decided to keep it simple at the outset. I'm happy to do whatever you think is best. I have a working implementation but need to find all the memory I'm leaking. 😂
The joys of C right 😂 If it's not too much trouble I think the namespace would be the way to go as it saves us changing it later down the line
No trouble at all. I completely it'll be best.