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

Cell output not shown in top-down order #28

Closed
darsnack opened this issue Aug 9, 2021 · 1 comment · Fixed by #29
Closed

Cell output not shown in top-down order #28

darsnack opened this issue Aug 9, 2021 · 1 comment · Fixed by #29
Labels
bug Something isn't working

Comments

@darsnack
Copy link
Contributor

darsnack commented Aug 9, 2021

According to the docs, cells that share a namespace are evaluated in top-down order. But it doesn't seem like the output matches this. Specifically, I have the following:

First cell:

{cell=namespace-A}
```julia
# some code
foo # show(foo) is the output of this cell
```

Second cell:
{cell=namespace-A}
```julia
# some code that mutates foo
foo # show(foo) is the output of this cell
```

The output of the first cell is affected by the second cell.

@MichaelHatherly MichaelHatherly added the bug Something isn't working label Aug 10, 2021
@MichaelHatherly
Copy link
Owner

Looks like it's probably https://github.com/MichaelHatherly/Publish.jl/blob/master/src/cells.jl#L59 where a reference to the value of a cell is stored in the AST for later display, so all cells get evaluated prior to calling show on the stored values, which surfaces the mutability you're seeing there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants