rhai icon indicating copy to clipboard operation
rhai copied to clipboard

Willingness to offer alternative Map types behind feature flags?

Open bellwether-softworks opened this issue 1 year ago • 1 comments

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.

bellwether-softworks avatar May 02 '24 18:05 bellwether-softworks

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.

schungx avatar May 03 '24 00:05 schungx

Closing this one for now until further interest.

schungx avatar Nov 26 '24 06:11 schungx