Open clarkevans opened 6 months ago
A cousin of this one. I tried export
and using
.
This notebook also fails, although it decides the using
is another definition of the module, and disables it.
### A Pluto.jl notebook ###
# v0.19.32
using Markdown
using InteractiveUtils
# ╔═╡ 6ecb601e-a769-11ee-1263-23270413abcb
module Test
hello = "World"
export hello
end
# ╔═╡ f7fc12e9-6d45-482e-9152-190c50cfa1a6
using .Test
# ╔═╡ 11403621-8fff-474a-8e21-520aac7b75fc
hello
# ╔═╡ Cell order:
# ╠═6ecb601e-a769-11ee-1263-23270413abcb
# ╠═f7fc12e9-6d45-482e-9152-190c50cfa1a6
# ╠═11403621-8fff-474a-8e21-520aac7b75fc
Hello. It seems that
import .LocalModule
does not calculate dependencies correctly. In the test notebook below, themodule Test
line should be first in the Cell order, but it is last. I use this mechanism to include one notebook within another. This approach lets me reliably skip code in an included notebook by wrapping it withif parentmodule(@__MODULE__) == Main
test (it'd be lovely if this were a more explicit option).