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

Automatically disable older cells to solve multiple defs #2273

Merged
merged 12 commits into from
Oct 18, 2022

Conversation

fonsp
Copy link
Owner

@fonsp fonsp commented Sep 7, 2022

This PR adds some extra code into update_save_run! that checks, by comparing the old and new Topologys:

  1. Did any of the cells (i.e. cells that the user wants to run) define a variable that was defined a fewer number of times in the old Topology?
  2. For each such cell:
    a. Does cell define exactly one variable?
    b. Are all definers of that variable not in cells? i.e. did the other definitions appear in a previous run?
    c. Are no function definitions involved?
    d. Are there no macro calls? (TODO)
    e. Does cell not reference itself? (e.g. x = x+1)
    f. Then: disable all other definers of the variable.

This is done fully in backend, which makes it accurate!

Demo

This video demonstrates the basic functionality, and then a series of situations where we purposefully do not use this new feature.

Schermopname.2022-10-07.om.17.07.27.mov

Previous/related work

TODO

@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2022

Try this Pull Request!

Open Julia and type:

julia> import Pkg
julia> Pkg.activate(temp=true)
julia> Pkg.add(url="https://github.com/fonsp/Pluto.jl", rev="auto-disable-multiple-definitions")
julia> using Pluto

@fonsp fonsp added backend Concerning the julia server and runtime reactivity The Pluto programming paradigm labels Oct 5, 2022
@fonsp
Copy link
Owner Author

fonsp commented Oct 14, 2022

Now with GUI!

Schermopname.2022-10-14.om.19.39.58.mov

@fonsp fonsp marked this pull request as ready for review October 14, 2022 17:59
src/evaluation/Run.jl Outdated Show resolved Hide resolved
src/evaluation/Run.jl Outdated Show resolved Hide resolved
@fonsp fonsp merged commit 5f5a1b8 into main Oct 18, 2022
@fonsp fonsp deleted the auto-disable-multiple-definitions branch October 18, 2022 22:19
@fonsp fonsp restored the auto-disable-multiple-definitions branch October 19, 2022 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Concerning the julia server and runtime reactivity The Pluto programming paradigm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants