Pluto.jl
Pluto.jl copied to clipboard
Confusing error and history-dependence with circular reference through `using`
Example notebook:
OrderedDict(1:5 .=> rand.(3))
begin
using DataStructures
k = sort!(collect(keys(d)))
end
- Assigning the
OrderedDict
of the first cell tod
it complains thatOrderedDict
is not defined, although it previously worked in the same cell. It should flag a cyclic reference instead. - Removing the assignment to
d
, the error on the first cell persists, although it wasn't there before in an identical notebook state. - Rerunning the last cell manually clears the error in the first cell (although the second cell still errors)
@Pangoraw the suggested fix is to treat a cycle as an error, even when some of the cyclic links are soft. What are the edge cases here? Would it be easy to implement?
I also can't explain the history dependence, how about you? @Pangoraw
This is probably caused by https://github.com/fonsp/Pluto.jl/pull/1668 (which was definitely a good change!)
This case in this issue should be a cyclic error, but it needs some puzzling to figure out how this issue differs from the ones fixed in #1668, and how to handle it. 🤔