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

Document UInt return type of objectid #40669

Merged
merged 1 commit into from
May 4, 2021
Merged

Conversation

fonsp
Copy link
Member

@fonsp fonsp commented Apr 30, 2021

It took me some time to figure out that objectid returns a UInt. typeof(objectid(123)) gave me the false belief that the return type is UInt64.

Is the return type for hash also fixed to UInt?

@fredrikekre
Copy link
Member

Is the return type for hash also fixed to UInt?

Looks like it

@dkarrasch dkarrasch added the docs This change adds or pertains to documentation label May 2, 2021
@Seelengrab
Copy link
Contributor

Seelengrab commented May 3, 2021

I'm confused - what's the return type of those two functions on a 32-Bit system? UInt is just an alias for either UInt64 or UInt32 after all, is the return type system dependent here?

@fonsp
Copy link
Member Author

fonsp commented May 3, 2021

is the return type system dependent here?

That's right, it returns a UInt, which is UInt32 or UInt64 depending on your system. I think this has something to do with pointers.

@Seelengrab
Copy link
Contributor

Seelengrab commented May 4, 2021

Looking through hashing.h and builtins.c, it's not immediately obvious to me why this is system dependent (other than it relying on pointer sizes), but I can tell that it would be a lot of work (and breaking at that) to change that to be consistent across systems. May also not be worthwhile 🤷‍♂️

Maybe there are more undocumented cases of methods not agreeing across systems, even though they're from the same version?

@KristofferC KristofferC merged commit 0fa39ec into JuliaLang:master May 4, 2021
@fredrikekre fredrikekre added the backport 1.6 Change should be backported to release-1.6 label May 4, 2021
@fonsp
Copy link
Member Author

fonsp commented May 4, 2021

@Seelengrab Unfortunately I am not the right person to ask (not a computer scientist), but you could restart this discussion on https://discourse.julialang.org/ to reach people who also understand this subject!

jarlebring pushed a commit to jarlebring/julia that referenced this pull request May 4, 2021
jarlebring pushed a commit to jarlebring/julia that referenced this pull request May 6, 2021
antoine-levitt pushed a commit to antoine-levitt/julia that referenced this pull request May 9, 2021
KristofferC pushed a commit that referenced this pull request May 11, 2021
@KristofferC KristofferC mentioned this pull request May 11, 2021
45 tasks
johanmon pushed a commit to johanmon/julia that referenced this pull request Jul 5, 2021
@KristofferC KristofferC removed the backport 1.6 Change should be backported to release-1.6 label Jul 12, 2021
staticfloat pushed a commit that referenced this pull request Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants