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

Changing semnatics of the functions #11

Closed
royKarseboom opened this issue Dec 21, 2021 · 1 comment
Closed

Changing semnatics of the functions #11

royKarseboom opened this issue Dec 21, 2021 · 1 comment

Comments

@royKarseboom
Copy link

Hi, I find the pointer.ToX(v X) *X a bit confusing since by reading it (without looking at the parameter and return value) I would think it would turn a pointer of X to the value X, which it doesn't.
Maybe we could change it to ptr.OfX(v X) *X
Also, in a similar manner, I think pointer.GetX(v *X) X would be clearer as ptr.ToX(v *X) X
To summerize, I'm suggesting the following changes

pointer.ToX(v X) *X -> ptr.OfX(v X) *X
pointer.GetX(v *X) X -> ptr.ToX(v *X) X

I don't mind opening the PR, would you accept?

@AlekSi
Copy link
Owner

AlekSi commented Apr 20, 2022

I read pointer.ToX(v X) as "[give me a] pointer to X".

In any case, that module will not have breaking changes in v1, and I plan to wait for golang/go#9097 or golang/go#45624 to be accepted and implemented before I release v2. If you want a different syntax, and you already have some module in from the list at #8 in dependencies, you might want to use them instead.

@AlekSi AlekSi closed this as completed Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants