Skip to content
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

“my” docs mentioning dynamic variables #1522

Merged
merged 4 commits into from Sep 5, 2017

Conversation

rafaelschipiura
Copy link
Contributor

Explains the relationship between lexical/package and normal/dynamic scope a bit more.

Asked in #1082

Explains the relationship between lexical/package and normal/dynamic scope a bit more.

Asked in  #1082
@@ -491,7 +492,7 @@ new-location; # OUTPUT: «outside␤»
=end code

To make C<new-location()> print C<nowhere>, make C<$location> a dynamic
variable using L<the * twigil|#The_*_Twigil>.
variable using L<the * twigil|#The_*_Twigil>. This twigil makes the compiler look up the symbol in the calling scope instead of the outer scope which is the case otherwise.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The compiler always looks in the current scope first. Looking into outer/caller's scopes is always a fallback. This description makes it sound as if only the caller's scope is searched.

@rafaelschipiura rafaelschipiura self-assigned this Sep 3, 2017
@zoffixznet zoffixznet merged commit 8c00cec into master Sep 5, 2017
@zoffixznet
Copy link
Contributor

👍 Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants