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

unexpected for outer behavior at repl? #24293

Open
Sacha0 opened this issue Oct 23, 2017 · 2 comments
Open

unexpected for outer behavior at repl? #24293

Sacha0 opened this issue Oct 23, 2017 · 2 comments
Labels
compiler:lowering Syntax lowering (compiler front end, 2nd stage)

Comments

@Sacha0
Copy link
Member

Sacha0 commented Oct 23, 2017

               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _' |  |
  | | |_| | | | (_| |  |  Version 0.7.0-DEV.2270 (2017-10-22 23:18 UTC)
 _/ |\__'_|_|_|\__'_|  |  expandlower/385177d (fork: 1 commits, 1 day)
|__/                   |  x86_64-apple-darwin15.6.0

julia> foo() = (k = 0; for outer k in 1:2 println(k) end; k)
foo (generic function with 1 method)

julia> foo()
1
2
2

julia> k = 0; for outer k in 1:2 println(k) end
ERROR: syntax: no outer variable declaration exists for "for outer"

Expected behavior, or should the latter work like the former? Best!

@JeffBezanson JeffBezanson added the compiler:lowering Syntax lowering (compiler front end, 2nd stage) label Oct 24, 2017
@JeffBezanson
Copy link
Member

This will depend a bit on #19324 and #23532.

@DanielVandH
Copy link

Has there been any update on this? #19324 and #23532 are both merged now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:lowering Syntax lowering (compiler front end, 2nd stage)
Projects
None yet
Development

No branches or pull requests

3 participants