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

Function can read and modify variables in outside scope #60

Open
sjoqvist opened this issue Aug 26, 2019 · 0 comments
Open

Function can read and modify variables in outside scope #60

sjoqvist opened this issue Aug 26, 2019 · 0 comments

Comments

@sjoqvist
Copy link

Possibly related to #38.

The 1.2 specification says

Currently, functions do not have access to the outer/calling code block's variables.

Nevertheless, on master, the following code

HAI 1.2
  I HAS A var ITZ "foo"

  HOW IZ I func
    VISIBLE var
    var R "bar"
  IF U SAY SO

  I IZ func MKAY
  VISIBLE var
KTHXBYE

prints

foo
bar

I would have expected an error message about undefined variables.

If a function can in fact modify variables in the outside scope while the specification says that it can't, then it gets harder to track down bugs.

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

No branches or pull requests

1 participant