-
Notifications
You must be signed in to change notification settings - Fork 292
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
Tighten Up Augment Example #4533
Comments
Thanks for improving the docs, I am still rather confused, I think the intent is to show some safer alternative to monkey patching IO::Path globally, where it only affects those that specifically opt in to it, but it is modifying IO::Path for everyone?
Another.rakumod:
and script.raku:
|
I edited my suggestion since IO::Barename is not needed to inherit from IO::Path if we rewrite it this way |
Yes - good check - it seems that Since this is the case, I think that better and safer augment (as suggested by the current docs) is just a silly idea and that we may as well remove the whole concept. I have edited the original suggested change accordingly. EDIT: s/MONKEY-TYPING/augment/ |
Hi @librasteve To be pedantic, It's
Note that you can't Why not? Because a (Per the original design there was discussion of being able to close a class too. This would have consequences, one being that one would not be able to inherit from or
Aiui the main existing problem, beyond The compiler's final step (I think) when processing a class declaration is to (Iirc, sub classes of an augmented class don't by default realize that their ancestor has been changed because it's I'd say the time to tighten up In the meantime, there are alternatives to |
Problem
https://docs.raku.org/language/variables#The_augment_declarator
The better usage example has confused some readers:
Here is a recent exchange on IRC:
Suggestions
Edited in the light that there is no such thing as better and safer augment...
** I suggest that we delete the above paragraph and example entirely **
The text was updated successfully, but these errors were encountered: