Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Methods with unnamed arguments do not re-evaluate #423

Closed
mossr opened this issue Sep 14, 2020 · 1 comment
Closed

Methods with unnamed arguments do not re-evaluate #423

mossr opened this issue Sep 14, 2020 · 1 comment
Labels
bug Something isn't working expression explorer Figuring out assignments and references in a cell good first issue Good for newcomers help welcome If you are experienced in this topic - let us know!

Comments

@mossr
Copy link
Contributor

mossr commented Sep 14, 2020

When we define a method with unnamed arguments like this

f(::Example) = 100

if the Example structure is modified, the cell defining f(::Example) does not re-evaluate.

Yet, if we define the method like this

f(var::Example) = 100

it works properly and this cell will update when Example is modified.

(Also, I have to say, using Pluto for teaching has been incredible—amazing work with this package 💕)

@mossr
Copy link
Contributor Author

mossr commented Sep 14, 2020

Here's the example notebook I've been using to test this:

### A Pluto.jl notebook ###
# v0.11.14

using Markdown
using InteractiveUtils

# ╔═╡ 49189bb0-f61f-11ea-0310-6dcf4f48a544
mutable struct Example end

# ╔═╡ 5182ff1e-f61f-11ea-0643-a953c85169d9
f(::Example) = 100

# ╔═╡ 657580c0-f61f-11ea-39fc-8527b48b1c27
f(Example())

# ╔═╡ Cell order:
# ╠═49189bb0-f61f-11ea-0310-6dcf4f48a544
# ╠═5182ff1e-f61f-11ea-0643-a953c85169d9
# ╠═657580c0-f61f-11ea-39fc-8527b48b1c27

I simply modify the first cell which results in the last cell throwing a MethodError.

@fonsp fonsp added bug Something isn't working expression explorer Figuring out assignments and references in a cell good first issue Good for newcomers help welcome If you are experienced in this topic - let us know! labels Sep 15, 2020
Pangoraw added a commit to Pangoraw/Pluto.jl that referenced this issue Sep 20, 2020
Pangoraw added a commit to Pangoraw/Pluto.jl that referenced this issue Sep 20, 2020
Pangoraw added a commit to Pangoraw/Pluto.jl that referenced this issue Sep 20, 2020
Pangoraw added a commit to Pangoraw/Pluto.jl that referenced this issue Sep 20, 2020
Pangoraw added a commit to Pangoraw/Pluto.jl that referenced this issue Sep 20, 2020
@fonsp fonsp closed this as completed in bbd2132 Sep 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working expression explorer Figuring out assignments and references in a cell good first issue Good for newcomers help welcome If you are experienced in this topic - let us know!
Projects
None yet
Development

No branches or pull requests

2 participants