Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
forgotpwd16
7 months ago
|
parent
|
context
|
favorite
| on:
New horizons for Julia
Another alternative is putting the code in a function and calling that function.
function test() s = 0 for i = 1:10 t = s + i s = t println("$s") end println("$s") end test()
For anyone curious, the rationale for this scoping is explained in the docs. Essentially it's to prevent the so-called spooky action at distance.
Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: