Cannot import function in Pluto

Hi all,

I recieve an error indicating multiple function definitions when I import a function and define a method. The attached image shows a simple example. Am I doing something incorrectly?

Version

Julia 1.7
Pluto 0.17.2

All methods definitions for a specific function must be done in the same cell.
(Edit: now this is not always necessary, see further comments)

For now, those statements have to be wrapped in a begin...end block:

begin
	import Distributions: rand
	function rand()
		
	end
end

https://github.com/fonsp/Pluto.jl/issues/7#issuecomment-878417670

Thank you for your help!

I find this behavior to be somewhat odd. As the attached image shows, its possible to specify multiple methods in different cells if the function is not imported. That is why I had difficulty solving the problem. Another option is to specify the module directly, i.e. Distributions.rand.

Nice, the multiple methods definition in different cells has been solved:
https://github.com/fonsp/Pluto.jl/pull/177

The specific issue with import is
https://github.com/fonsp/Pluto.jl/issues/846

1 Like