-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
Aliasing objects with uniqueness refcap constraint by method invocation #262
Comments
I do think covering method invocation in greater detail with respect to capabilities in the Aliasing section does make sense. Just to get this out quickly before the tutorial section is written: @TheCheapestPixels if you have a type To make matters worse, there is also: https://tutorial.ponylang.org/capabilities/recovering-capabilities.html#automatic-receiver-recovery |
This isn't exactly true. The receiver inside of a function is what the receiver capability says it is. So the receiver in a
class String
fun add(that: String box): String val =>
let s: String iso = recover String end
(consume s)._append(this)._append(that)
fun iso _append(s: String box): String iso^ =>
/* Implementation code to append the new String
* ...
*/
consume this I agree that the tutorial section does need to be updated with more details, especially considering that even you got confused @mfelsche. |
Is this covered by #449? If not, can/should it be included there? @jasoncarr0 What are your thoughts on including a resolution on this issue with your PR? |
This is touched upon but not exactly covered in #449 as it doesn't go into much detail about function receivers, and probably could use a bit more work around what causes aliasing. I think it's definitely worthwhile to roll in, although it won't be able to be merged until we can get PRs merged for ponyc |
This addition is low enough priority/maintenance that the fix being held off a bit longer is okay in my opinion. @jasoncarr0 Do you have an idea of where/how to include this with #449? Anyway I can help beyond reviewing once this is included? |
@rhagenson I'd have to think about where this could fit. In effect I'd expect this needs to be in a section that describes receiver capabilities or "formally" describes what is actually aliasing. Tbh those could well be made independent. While looking at this I noticed there's a slight explanation around automatic receiver recovery:
Realizing this section may also need to be updated anyway (if only to clean up the |
Are you meaning independent sections, or independence between receiver capabilities and aliasing? Re: automatic receiver recovery. Looking at that same section I want to rewrite it for clarity anyhow so if this fix is not rolled into your PR then I can handle it on a rewrite. |
I believe I was referring to independence from my changes. But in some sense they're nearly independent from each other as well. |
https://github.com/ponylang/pony-tutorial/blob/master/capabilities/aliasing.md#what-counts-as-making-an-alias states (point 3) that calling an object's method creates an alias,
this
, of that object. That seems to imply that aniso
object either can't have its method called, or that thethis
will be atag
, both of which sound unlikely. The whole matter of method invocation interacting with reference capability feel a bit under-documented.The text was updated successfully, but these errors were encountered: