Re: [heycam/webidl] record with arbitrary value types as keys? (#509)

Thanks for the quick response.
Dictionary instead of record in the case of enum would works, but if we use a dictionary then we have to define every name in two places instead of just saying it's a mapping.

Dictionary in the case of integers doesn't work with this restriction. And Maplike is an interface (copy-by-reference), not a dictionary (copy-by-value). We want copy-by-value.

As for _"K is effectively a property in a JavaScript object so has to be a string"_. If we allow other Ks then it would be possible to have records that are not JavaScript objects, sure, but you can still say that any JavaScript object is a record, so it would be perfectly sensible for a spec to say something is a record, and to have the implementation of that spec implement it as a JavaScript object.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/509#issuecomment-356623243

Received on Wednesday, 10 January 2018 14:51:35 UTC