Hello!
I am using Julia 0.6 and running in Juno. All packages are up-to-date.
I am getting ‘syntax: incomplete: premature end of imput’ and ‘unsupported or misplaced expression “using” in function’ errors.
I have no problems with the following code:
using Plots
gr()
t = 0:.1:100;
plot(t, sin.(t))
I can run it or press shift+enter after each line and it produces the expected results.
However, when I try to turn it into a function like so:
function PlotSin()
using Plots
gr()
t = 0:.1:100;
plot(t, sin.(t))
end
I get the “premature end of input” error after the function delcaration (when using shift+enter). Next, if I try to call it in the console, I get the “misplaced expression” error.
I’ve tried this for a few other sample bits of code and the same thing happens—the code runs fine until I try to turn it into a function.
As I’m new to Julia, I could use a hand to figure out what’s going on.
Thanks!