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

Variable is defined although the cell defining it errors

Open yha opened this issue 2 years ago • 0 comments

In this example, y is defined although the cell defining it errors after assigning to y. The very similar cell defining z also errors after assigning to z, but in this case z remains undefined, which I think is the better behavior.

image

### A Pluto.jl notebook ###
# v0.19.10

using Markdown
using InteractiveUtils

# ╔═╡ 513ba1f0-0df3-11ed-04fa-cfdc57ed13ba
x = rand(10)

# ╔═╡ 96b27d7e-981d-4eb9-b90f-a2f1ae8da5a1
begin
	y = copy(x)
	filter!(isspecial, y)
end

# ╔═╡ 9a9d7bba-cb9d-4986-9a50-80662890a92f
y

# ╔═╡ 4590835d-9d34-47e9-99b7-de6c68ce2ab1
begin
	z = copy(x)
	error()
end

# ╔═╡ 82b931a8-d5ff-4b97-a07f-dc4cf6309aef
z

# ╔═╡ 00000000-0000-0000-0000-000000000001
PLUTO_PROJECT_TOML_CONTENTS = """
[deps]
"""

# ╔═╡ 00000000-0000-0000-0000-000000000002
PLUTO_MANIFEST_TOML_CONTENTS = """
# This file is machine-generated - editing it directly is not advised

julia_version = "1.7.2"
manifest_format = "2.0"

[deps]
"""

# ╔═╡ Cell order:
# ╠═513ba1f0-0df3-11ed-04fa-cfdc57ed13ba
# ╠═96b27d7e-981d-4eb9-b90f-a2f1ae8da5a1
# ╠═9a9d7bba-cb9d-4986-9a50-80662890a92f
# ╠═4590835d-9d34-47e9-99b7-de6c68ce2ab1
# ╠═82b931a8-d5ff-4b97-a07f-dc4cf6309aef
# ╟─00000000-0000-0000-0000-000000000001
# ╟─00000000-0000-0000-0000-000000000002

yha avatar Jul 27 '22 21:07 yha