I don’t know the answer to your question…but it sounds similar to some 
functionality I was looking for a while back. I wanted to be able to pass a 
range of line numbers to include and only have those lines executed. 
Sometime like include(script.jl, 1:100) which would only run lines 1-100. I 
ended up writing the following function and putting it in my .juliarc.jl. 
It seems to work fine for my use case. Not sure if it will be useful to you 
tho. 

function Base.include{T<:Int}(path::AbstractString, lines::AbstractVector{T})
    lns = open(readlines, path)
    include_string(join(lns[lines]))
end

On Tuesday, October 25, 2016 at 2:27:41 PM UTC-7, David van Leeuwen wrote:

Hello, 
>
> is there a way in Julia for a file that is `include`d to signal that the 
> rest of the file should be ignored?  Something like `\endinput` in TeX.   
>
> I could use this in running testing scripts, putting such and `endinput` 
> further to the back while debugging the script.  Currently I wrap the 
> remainder of the script in `if false ... end`.  That works, when the 
> remainder is syntactically correct. 
>
> Thanks, 
>
> ---david
>
​

Reply via email to