-
Notifications
You must be signed in to change notification settings - Fork 1
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
@within should explicitly allow @private access #2
Comments
I think a case could be argued either way, but I can't say for certain whether I considered this case at all when writing the documentation. I'll have to take a deeper look. IIRC DHP also allows globs, so you can do something like |
What would be an argument against it?
That's true, but there may be other files in that folder which have no business for the within function |
Playing devil's advocate here: with multiple similarly-named functions you could accidentally introduce an infinite loop and it would be difficult to track down. If functions are by default hidden from themselves, this is unlikely to happen unless you've explicitly stated that the function can run itself. That being said, it's still possible to introduce a larger, external circular reference. The driving purpose of Another, similar idea: introduce |
I think in general, I'd like an annotation like Perhaps this could even be taken further, with an annotation Should this imply that a function that is not tagged with any of these implies it cannot call itself, no matter the access level?
In that case, I think the name |
From the current specification, it is unclear whether a function with a
@within
visibility is allowed to call itself.However, it happens commonly for me, that I need a loop that is tailored to be used in a specific function and should not be used elsewhere.
Dph+ follows the specification in that regard and errors when I try to call a
@within
-defined function from within itself so I commonly end up with things like these:I would like to avoid this and generally think it is weird to be able to make a function invisible for itself.
The text was updated successfully, but these errors were encountered: