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

Dependency on copy isn't detected #417

Closed
frycast opened this issue Sep 12, 2020 · 1 comment
Closed

Dependency on copy isn't detected #417

frycast opened this issue Sep 12, 2020 · 1 comment
Labels
one day Closed because we won't work on it soon, will be opened again later.

Comments

@frycast
Copy link

frycast commented Sep 12, 2020

As expected, the below assigns 5 to v[1].

# ╔═╡ cc0c1db0-f4dc-11ea-2f85-dd812a3de9b1
v = [1 2 3]

# ╔═╡ d2905c00-f4dc-11ea-367a-a5073a34c7db
begin
w = v
w[1] = 5
v
end

But if now we change the second cell above, to make a copy of v:

# ╔═╡ d2905c00-f4dc-11ea-367a-a5073a34c7db
begin
w = copy(v)
w[2] = 5
v
end

Then my expectation is that when I run the updated second cell, the first cell should automatically be rerun so that the output of the second cell reflects what it would be if the whole notebook was run from scratch. Instead, after updating and running the second cell, I get

1×3 Array{Int64,2}:
 5  5  3
@fonsp
Copy link
Owner

fonsp commented Sep 12, 2020

This is very very difficult. Even the simple task of knowing which functions mutate which arguments is hard:
#316 (comment)
@lungben

@fonsp fonsp added the one day Closed because we won't work on it soon, will be opened again later. label Sep 12, 2020
@fonsp fonsp closed this as completed Sep 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
one day Closed because we won't work on it soon, will be opened again later.
Projects
None yet
Development

No branches or pull requests

2 participants