Reading http://docs.julialang.org/en/release-0.4/manual/running-external-programs/ for reference, I was surprised to find that this doesn't work. And it seems like a bug to me:
function runls():
run(`ls`)
end
runls()
LoadError: MethodError: `call` has no method matching call(::Symbol, ::Cmd)
Closest candidates are:
BoundsError()
BoundsError(!Matched::Any...)
DivideError()
...
while loading In[34], in expression starting on line 4
in runls at In[34]:2
Maybe the syntax error for a trailing : at the end of a line should be extended to include quoting expressions?
Is there an obvious workaround for this?
Delete the :
Oh, that's an embarrassing bug report on my part.
The parser should probably give a better error here.
@dmyersturnbull funnily enough, I'm also coming from Python and have committed this exact error several times. I agree that the parser should give a better error for this case.
The parser should probably give a better error here.
I assume you mean the parser should give an error here since this is currently parsed as valid syntax. Given that https://github.com/JuliaLang/julia/issues/15173 was closed due to more explicit errors for python syntax, I agree we should deprecate quoting syntax that spawn multiple lines (or even with with white space after the :) and make it an error later.
Most helpful comment
The parser should probably give a better error here.