[julia-users] name of current executable (similar to Bash $0)

2016-07-21 Thread Curtis Vogt
I believe what you want is the constant `PROGRAM_FILE`. http://julia.readthedocs.io/en/latest/stdlib/constants/#Base.PROGRAM_FILE

Re: [julia-users] Re: Private Forks of Julia Repositories

2016-06-03 Thread Curtis Vogt
Maybe Playground.jl will fit your use case. It works similarly to Python's virtualenv which allows having multiple versions of the same package to be installed at the same time. https://github.com/Rory-Finnegan/Playground.jl

[julia-users] Private Forks of Julia Repositories

2016-06-02 Thread Curtis Vogt
If you don't need to have both versions of the package available at the same time then I would recommend using a single Git repo with multiple remotes. With this setup you can push to your private remote for experiments and later push to the public remote when your ready to share your work.

Re: [julia-users] Convert Method or LambdaInfo into an Expression

2016-05-05 Thread Curtis Vogt
> > It would be easy enough to write a macro A good idea but in my use case I want to be able to turn almost any method into an expression including those in Base which I can't easily add a macro to. Look at code_lowered Thanks, I'll make sure to check that out. I was looking at code_typed

Re: [julia-users] Convert Method or LambdaInfo into an Expression

2016-05-05 Thread Curtis Vogt
at 3:59:20 PM UTC-5, Yichao Yu wrote: > > On Thu, May 5, 2016 at 3:45 PM, Curtis Vogt <curti...@invenia.ca > > wrote: > > I doubt this is possible but is there a way of creating an expression > from a > > Method or LambaInfo? Something like: > > > &g

[julia-users] Convert Method or LambdaInfo into an Expression

2016-05-05 Thread Curtis Vogt
I doubt this is possible but is there a way of creating an expression from a Method or LambaInfo? Something like: julia> m = first(methods(open, (AbstractString,))) open(fname::AbstractString) at iostream.jl:99 julia> Expr(m) ERROR: TypeError: Expr: expected Symbol, got Method in

Re: [julia-users] Re: Julia command line usage: tool versus library

2016-04-01 Thread Curtis Vogt
There does exist a way to do this in Julia 0.5 using the PROGRAM_FILE constant: Given the file: "example.jl" if abspath(PROGRAM_FILE) == @__FILE__ println("Running file") else println("Included file") end

[julia-users] Creating docstrings using code generation

2016-03-03 Thread Curtis Vogt
I was hoping to generate several redundant docstrings using code generation. Unfortunately I have run into an issue where $name isn't being replaced in the docstring: julia> using Base.Dates julia> for name in (:year, :month, :day, :hour, :minute, :second, : millisecond) @eval begin

[julia-users] Overwriting Functions

2015-11-28 Thread Curtis Vogt
I've been working on a package Mocking.jl which allows developers to temporarily overwrite a method in order to facilitate testing. I've got everything working pretty well with the exception of the creation of a new macro which is suppose to ensure that

[julia-users] Announcing TimeZones.jl

2015-10-17 Thread Curtis Vogt
The TimeZones.jl package has been around for a while but now it has a functional interface. The latest v0.1.0 release includes: - New types including: `ZonedDateTime`, `FixedTimeZone`, and `VariableTimeZone` - "Calendrical" `ZonedDateTime` math (see documentation) - Local system