# Let x = 1 # ParseError

**URL:** https://discourse.julialang.org/t/let-x-1-parseerror/130050
**Category:** General Usage
**Tags:** question, bug, repl
**Created:** [June 20, 2025, 5:35am UTC](https://discourse.julialang.org/t/let-x-1-parseerror/130050 "2025-06-20T05:35:38Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![WalterMadelim](https://avatars.discourse-cdn.com/v4/letter/w/3e96dc/32.png) [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)
#### Post date: [June 20, 2025, 5:35am UTC](https://discourse.julialang.org/t/let-x-1-parseerror/130050/1 "2025-06-20T05:35:39Z")

</div>

I don’t know what’s going wrong here.

```julia
PS K:\uc24> julia
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.11.5 (2025-04-14)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

```

```julia
julia> let x = 1
       x
       end
1

julia> let x = 1 #
ERROR: ParseError:
# Error @ REPL[2]:1:10
let x = 1 #
# └ ── premature end of input
Stacktrace:
 [1] top-level scope
   @ none:1

```

---

<div class="post-metadata">

### Author: ![WalterMadelim](https://avatars.discourse-cdn.com/v4/letter/w/3e96dc/32.png) [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)
#### Post date: [June 20, 2025, 5:40am UTC](https://discourse.julialang.org/t/let-x-1-parseerror/130050/2 "2025-06-20T05:40:54Z")

</div>

It looks like that functions don’t suffer this

```julia
julia> function mysum(a, #
       b)
       return a + b
       end
mysum (generic function with 1 method)

julia> mysum(3, 4)
7

```

---

<div class="post-metadata">

### Author: ![Sevi](https://avatars.discourse-cdn.com/v4/letter/s/c67d28/32.png) [@Sevi](https://discourse.julialang.org/u/Sevi)
#### Post date: [June 20, 2025, 5:46am UTC](https://discourse.julialang.org/t/let-x-1-parseerror/130050/3 "2025-06-20T05:46:50Z")

</div>

Might be an issue with the REPL and how unfinished expressions are recognized? Or perhaps there is some ambiguity in the unfinished `let` block?

The function example should work because the open parenthesis `(` is always enough to tell that the expression is not complete yet.

But this also works

```julia-repl
julia> begin x = 1 #
       end
1

```

---

<div class="post-metadata">

### Author: ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)
#### Post date: [June 20, 2025, 6:13am UTC](https://discourse.julialang.org/t/let-x-1-parseerror/130050/4 "2025-06-20T06:13:39Z")

</div>

Definitely a REPL limitation, like how we get a `ParseError` in strings or code if we input too many newlines even though that’d be fine if `include`-d from a file. Couple weird workarounds:

```julia
julia> let x = 1 # wrote this comment after the next line
        x
       end
1

julia> let x = 1; # wrote this comment immediately
        x
       end
1

```

---

<div class="post-metadata">

### Author: ![WalterMadelim](https://avatars.discourse-cdn.com/v4/letter/w/3e96dc/32.png) [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)
#### Post date: [June 20, 2025, 6:23am UTC](https://discourse.julialang.org/t/let-x-1-parseerror/130050/5 "2025-06-20T06:23:55Z")

</div>

So it’s a bug. Will it be fixed?

* * *

Update: I’ve opened an issue [Let x = 1 # ParseError · Issue #58782 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/58782)

---

<div class="post-metadata">

### Author: ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)
#### Post date: [June 20, 2025, 6:36am UTC](https://discourse.julialang.org/t/let-x-1-parseerror/130050/6 "2025-06-20T06:36:46Z")

</div>

Like most users, I have no idea. You might see where the developers are at if you open a Github issue about this. If it’ll help, this particular REPL limitation seems to have started in v1.10 when JuliaSyntax.jl replaced the femtolisp-based parser; you can confirm by comparing v1.9 and v1.10.

---

<div class="post-metadata">

### Author: ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)
#### Post date: [July 1, 2025, 1:25am UTC](https://discourse.julialang.org/t/let-x-1-parseerror/130050/7 "2025-07-01T01:25:47Z")

</div>

3 posts were split to a new topic: [Syntax of multiple let assignments vs tuples](https://discourse.julialang.org/t/syntax-of-multiple-let-assignments-vs-tuples/130357)
