Defining My Own Module, is indentation required?

I created a module but it wouldn’t compile (in ATOM) unless I indent all the code inside the module. Is there a reason for this?

Here’s a minimal-ish working example.

module MyModule

using Distributions, Statistics, LinearAlgebra

function Ray(lambda)
    Distributions.Rayleigh(lambda)
end

end

In ATOM, this throws the error syntax: incomplete: premature end of input and it only creates MyModule when I indent all the code between the first line and the last line.

I thought Julia was supposed to not care about indentation and lines. Is this only an ATOM thing? If so, do you know how to disable it?
Thank you.

That very much depends on how you evaluate code. Ctrl-Enter runs the current line or code block, where code block is defined by indentation (unless you’re on the first line of a module definition, IIRC). So you might want to try using one of the “Run File” commands instead.

Also worth noting that Juno isn’t really developed anymore and you might want to give the Julia extension for VS Code a go.

Thank you, this was silly of me. I’m not just new to julia, I’m not that an efficient coder either, before this I mostly did things in cells of jupyter notebooks.

I just downloaded VS code, and will try this. Didn’t know Atom wasn’t being developed. I prefer using the most popular ide for the given language anyways.