You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This probably is more revealing about me, but I went through the tutorial in order, and came out not understanding that classes, and more importantly for my usages that this was a thing.
My specific context was a tag reference of the current actor that could be sent to another actor so that they could have some bi-directional communication.
This was discussed in Zulip with @SeanTAllen (my zulip client on linux won't let me copy the link, sorry look in #beginner-help > "Self" reference for actors).
I think the sugar of not needing to use this when setting actor and class fields, or calling their methods and behaviors led me to not even think of it.
:
There is one reference in "Expression > Methods"
Functions are always called on an object. Again just specify the object, followed by a dot, followed by the name of the function to call. If the object to call on is omitted then the current object is used (i.e. this).
The text was updated successfully, but these errors were encountered:
I suggest that we add an example to the https://tutorial.ponylang.io/types/actors.html page where we introduce actors, to show one actor calling another actor and using this to give a reference to itself, which the other actor uses to call it back.
We also discussed what I am going to call the "usage curve of sugar" in the Tutorial. It was suggested that we remove sugar in early examples so the non-obvious is made obvious. My personal opinion on this is that, for learning, sugar is best used when we know we are working with new Pony users (as we are with the Tutorial). Manual desugaring is an intermediate step in fully understanding Pony. This is because, as we noted in the call today, forcing manual desugaring in early examples overcomplicates those examples for new users since cleaner, more easily understood examples with sugar can be written.
On this specific instance, this is not fully fixed by any "usage curve of sugar" as there is no sugar in it being needed for passing a self-reference across actor/object boundaries. I am in favor of adding a this-necessary example in the Concurrent subsection on the Actors page Joe posted to document self-reference passing.
Are there any other places in the Tutorial that we want to clarify the sugared usage of this? Perhaps in Classes for field access, or Methods so the existing i.e. parenthetical is more connected with the concept on that page?
This probably is more revealing about me, but I went through the tutorial in order, and came out not understanding that classes, and more importantly for my usages that
this
was a thing.My specific context was a
tag
reference of the current actor that could be sent to another actor so that they could have some bi-directional communication.This was discussed in Zulip with @SeanTAllen (my zulip client on linux won't let me copy the link, sorry look in #beginner-help > "Self" reference for actors).
I think the sugar of not needing to use
this
when setting actor and class fields, or calling their methods and behaviors led me to not even think of it.:
There is one reference in "Expression > Methods"
The text was updated successfully, but these errors were encountered: