Pluto.jl icon indicating copy to clipboard operation
Pluto.jl copied to clipboard

cannot assign a value to variable BuiltinsNotebook.br from module workspace#41

Open cormullion opened this issue 2 years ago • 5 comments

I have a weird error if I use a variable called br:

Video:

https://user-images.githubusercontent.com/52289/157880953-501fe517-4776-4720-a669-b3e32c398819.mov

Notebook:

mobius-pluto.jl.zip

I haven't tried all the two letter variable name possibilities but I have a sneaking suspicion that it's something to do with HTML...

cormullion avatar Mar 11 '22 13:03 cormullion

I guess it conflicts with PlutoUI.br some way

dralletje avatar Mar 11 '22 17:03 dralletje

Smaller example

# ╔═╡ 5919be3d-f8ce-4a0a-ab36-2d3975ca9aa9
using PlutoUI

# ╔═╡ b9bf1762-9a6a-4a78-9240-2adace14d2e2
begin
	br = 10
	for _ in a
		br
	end
end

dralletje avatar Mar 11 '22 17:03 dralletje

Smaller example

This also happens in the REPL.

In my understanding, the error should only happens if you reference the variable before the assignment. Does it have something to do with the for loop scope ?

using PlutoUI

begin
    br
    br = 1 # Fails
end
using PlutoUI

begin
    br = 1 # Succeeds
end
using PlutoUI

begin
    br = 1 # Fails but shouldn't?
    for _ in false
        br
    end
end

Pangoraw avatar Mar 12 '22 16:03 Pangoraw

Follow up issue in https://github.com/JuliaLang/julia/issues/44604

Pangoraw avatar Mar 13 '22 19:03 Pangoraw

@Pangoraw what an amazing find D:

dralletje avatar Mar 22 '22 14:03 dralletje