-
Notifications
You must be signed in to change notification settings - Fork 326
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
NaN cannot be used as a key in Map #5833
Comments
Probably also worth adding a test for
(using |
Let's be sure to test the custom types properly, i.e. have tests for a custom type like As @Akirathan mentioned, this may be blocked by #5709 |
Pavel Marek reports a new STANDUP for today (2023-04-17): Progress: Updating bench results - I had broken cache locally, so I have spent some time investigating why some older bench results are not displayed. Benchmarks https://enso-org.github.io/engine-benchmark-results/ now contain results from Dec 2022, until today. NaN can now be used as a key in the map, and complies to the Same value zero equality JS specs It should be finished by 2023-04-20. |
Pavel Marek reports a new STANDUP for today (2023-04-18): Progress: Polish, add some tests. Ready for review. Bookclub, review other PRs. It should be finished by 2023-04-20. |
Pavel Marek reports a new STANDUP for yesterday (2023-04-19): Progress: Last nits before merging, adding some last tests. It should be finished by 2023-04-20. |
The primary motivation for
Map
existance is implementation ofVector.distinct
. To make such implementation easy/fast/possible we don't want errors fromMap.insert
. On contrary, we want every object to provide hash code - so it can be used as a key for theMap
. Constraints:m.insert k v . contains_key k == True
Number
we are going to use JavaScript's Equality comparisons and sameness to ensureNaN
works as a keyMeta.is_same_object
implies that they areAny.==
which in turn satisfies the first pointFollowing code shows the expected behavior for custom types that violate reflexivity:
e.g. , we will do a best effort solution. Thanks to
Any.==
relying onMeta.is_same_object
, even ifcompare
implementation is always incomparable,x==x
will beTrue
. Multiple separate instances of incomparable atoms will however not be.Follow up of
Tasks
The text was updated successfully, but these errors were encountered: