Pluto.jl icon indicating copy to clipboard operation
Pluto.jl copied to clipboard

Confusing error and history-dependence with circular reference through `using`

Open yha opened this issue 2 years ago • 2 comments

Example notebook:

OrderedDict(1:5 .=> rand.(3))
begin
	using DataStructures
	k = sort!(collect(keys(d)))
end
  1. Assigning the OrderedDict of the first cell to d it complains that OrderedDict is not defined, although it previously worked in the same cell. It should flag a cyclic reference instead.
  2. Removing the assignment to d, the error on the first cell persists, although it wasn't there before in an identical notebook state.
  3. Rerunning the last cell manually clears the error in the first cell (although the second cell still errors)

pluto-using

yha avatar May 03 '22 15:05 yha

@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?

fonsp avatar May 07 '22 12:05 fonsp

I also can't explain the history dependence, how about you? @Pangoraw

fonsp avatar May 07 '22 12:05 fonsp

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. 🤔

fonsp avatar Apr 25 '23 20:04 fonsp