-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
make isequal compare identity by default #90
Comments
Another, related issue I just though of is comparison of mutable types by
Based on what we've discussed before, we should have:
since mutable objects are by default compared by identity because you can change |
I've come to the conclusion that
|
I had come to a similar conclusion regarding
However, I don't think we can reasonably require the same thing with But maybe we're not disagreeing after all. As I understand it, here are some reasonable implications:
The question is which ones should "collapse" to equivalence. The |
They can actually hash the same; it would be valid for every value to have the same hash, just suboptimal. One thing that hasn't been stated explicitly here is that we currently don't have a function that compares generic structs recursively (for arbitrary objects, we only have
One of the few constraints on This is why we need to forget about To answer your question, I don't think |
What I was getting at was that I think the default behavior should be this:
|
Oh, ok, I totally agree with that. And in the meantime, until we have actual immutable objects, types like I think what we need to do is change most of our
|
isequal() is the primitive comparison function. . it defaults to is() . is generally only true for arguments of the same type types with "value type" semantics should define isequal and hash appropriately subtypes of Number may define == instead of isequal for aesthetics == defaults to isequal(). only define it for number-like things where some special behavior is needed (e.g. type promotion, IEEE-754, etc.)
The docstring for `llvmcall` was bound to a keyword rather than the actual intrinsic `Core.Intrinsics.llvmcall`. This produced the following odd behaviour when trying to find the docs: help?> llvmcall ... docs ... julia> llvmcall ERROR: UndefVarError: llvmcall not defined help?> Base.llvmcall ... no docs ... julia> Base.llvmcall (intrinsic function JuliaLang#90)
The docstring for `llvmcall` was bound to a keyword rather than the actual intrinsic `Core.Intrinsics.llvmcall`. This produced the following odd behaviour when trying to find the docs: help?> llvmcall ... docs ... julia> llvmcall ERROR: UndefVarError: llvmcall not defined help?> Base.llvmcall ... no docs ... julia> Base.llvmcall (intrinsic function JuliaLang#90)
Added weighted median function and tests
See this discussion:
http://groups.google.com/group/julia-math/browse_thread/thread/d9b27f68ffe6e85a/bdf8c3662affd183
We want hash tables to hash by object identity by default. In general, these definitions don't seem quite right:
The text was updated successfully, but these errors were encountered: