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?


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:

	import Distributions: rand
	function rand()

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:

The specific issue with import is

1 Like