On 31 October 2014 18:46, Jason Merrill <jwmerr...@gmail.com> wrote:

> On Thursday, October 30, 2014 11:42:38 PM UTC-7, Daniel Carrera wrote:
>
>>
>> The point is that Julia will parse the entire line and form a parse tree
>> before it begins to interpret the instruction. Therefore, the @run line has
>> to parse correctly as valid Julia syntax.
>>
>> If you want to type fewer quotation marks, one could make a macro that
>> takes everything as one string:
>>
>> @run "test.jl  --fast a -r 3"
>>
>> The macro can split the string along the spaces.
>>
>
> Note that macros that are meant to be called with a single string can be
> non-standard string literals
>


Yes, indeed. You could also shorten it to R"test.jl 1 2 3". But personally
I don't think it makes sense for the @run macro to take in a single string.
I think that would make it less useful. For example, suppose that you had a
function that produced the parameters that go to the external script. I
would rather write

@run "script.jl"  params()

than

R"script.jl $( params() )"

Then again, this is just a personal preference. Personally I think that
include() already does the job I want.

Cheers,
Daniel.
-- 
When an engineer says that something can't be done, it's a code phrase that
means it's not fun to do.

Reply via email to