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

Implement Hash of object #120

Open
HyeockJinKim opened this issue Oct 20, 2019 · 1 comment
Open

Implement Hash of object #120

HyeockJinKim opened this issue Oct 20, 2019 · 1 comment

Comments

@HyeockJinKim
Copy link
Contributor

@HyeockJinKim HyeockJinKim commented Oct 20, 2019

We have to calculate the hash according to the type of Object and return a value.
There is currently M__hash__ but it is not implemented in any Object.

type I__hash__ interface {
	M__hash__() (Object, error)
}

First, we have to implement M__hash__ of numbers and strings(int, float, complex, string).
This is also necessary for the implementation of the dictionary.

@ncw
Copy link
Collaborator

@ncw ncw commented Oct 21, 2019

I note that in go1.14 the go team have exported the internal hasher

golang/go@bf36219

This makes uint64 hashes which would work very well for our purpose.

That said we could start with a much simpler hashing function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.