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

Willingness to offer alternative Map types behind feature flags? #868

Open
bellwether-softworks opened this issue May 2, 2024 · 1 comment

Comments

@bellwether-softworks
Copy link

I'm aware of the reasoning for the use of BTreeMap, but find myself in a place where I could benefit greatly from ordered keys. I was curious if there was any potential for offering alternatives (e.g. IndexMap) as opt-in features.

@schungx
Copy link
Collaborator

schungx commented May 3, 2024

I won't object but then the feature won't be additive... although most of Rhai's flags are non-additive anyway, so that by itself isn't a very big deal.

Another thing to consider is that I would much rather any new Map type to be API-compatible with BTreeMap so that existing code does not need to be modified/rewritten/duplicated. I am not sure about IndexMap, so you can probably try and see how many changes to the existing code base there will be.

I would suggest the feature flag to be called ordered_maps to be consistent with other crates.

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