In “func ( r receiver)”
what is “r”? Is it an identifier?
Sorry if my questions sound infantile. I have nowhere else to ask such questions
In “func ( r receiver)”
In this example, the
Absmethod has a receiver of type
To be honest, what should it be otherwise? even
receiver is an identifier… At least in the place where you have that word…
Go does not have classes. I have no idea what that means.
There are so many things on this page that I know nothing about.
receiver is an identifier Thanks!
But this is the section you’re referring to: the
Abs method has a receiver of type
Thank you. I just have to keep at it and eventually it will become clear
So this receiver is named r?
Just working on terminology here
Yes. But even though its of type
receiver, its not necessarily the receiver of a method, as the snippet you have shown is either incomplete (it lacks the actual method name, arguments and return type) or is the type of a function that takes a single argument of type
receiver and returns nothing/
To be more specific, when Go speaks of an identifier, is this a term that is specific to Go? And/or programming? Or are we to understand “identifier” as the common English definition “a person or thing that identifies something.” In looking for this last, I found, "COMPUTING a sequence of characters used to identify or refer to a program or an element, such as a variable or a set of data, within it.
I must be on the right track.
While possibly seeming elementary, this word has sounded like a foreign language to me, as I consider all the elements of Go until I know their definition specifically.
This is useful
More terms that almost, but not quite, mystify me.
Method, I have no clue.
Name, I’ve got down.
Arguments, I’m starting to get, but I don’t have a clear definition.
Return, all I’ve got in my head is that it’s something that returns something…so a bit nebulous.
Type used to really confuse me. Previously type to me was something that you typed, ie with a typewriter (I’m old) or computer keyboard. This definition has been very helpful to me: “a classification of data”
May I point you back to this advice?
I fear that for you Go and this forum are not good choices for starting to learn programming.
A completely different approach could be Scheme and the very good and thorough book How to Design Programs (available online). Please take a look, not to short, at this book. Spend some hours or days trying to understand what it teaches. Perhaps this is an approach that works for you.
Thank you for your opinion, but I don’t think you are correct
I understand it as “the target parameter”.