# Use of variable in Julia REPL

**URL:** <https://discourse.julialang.org/t/use-of-variable-in-julia-repl/24843>\
**Category:** General Usage\
**Created:** [June 1, 2019, 11:32pm UTC](https://discourse.julialang.org/t/use-of-variable-in-julia-repl/24843 "2019-06-01T23:32:32Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [June 2, 2019, 1:36am UTC](https://discourse.julialang.org/t/use-of-variable-in-julia-repl/24843/5 "2019-06-02T01:36:50Z")

</div>

Which version are you on? With the 1.1 Julia (

```julia
julia> versioninfo()
Julia Version 1.1.0
Commit 80516ca202 (2019-01-21 21:24 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-6650U CPU @ 2.20GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
Environment:
  JULIA_EDITOR = "C:\Users\PetrKrysl\AppData\Local\atom\app-1.37.0\atom.exe" -a
  JULIA_NUM_THREADS = 2

```

) I get the same result as you. I think the scoping rules ([New scope solution - #53 by StefanKarpinski](https://discourse.julialang.org/t/new-scope-solution/16707/53)) may be in effect.  
In the first case, the variable is read, and the globally visible `x` is printed.  
In the second case, the variable is written into (it is incremented), and therefore it is assumed to be a local variable, and since the local `x` does not exist, an error is reported.

---

_[View the full topic](https://discourse.julialang.org/t/use-of-variable-in-julia-repl/24843)._
