Re: [julia-users] Forming run() calls programatically

2016-05-13 Thread Andrew Gibb
Those methods both work, and help me understand metaprogramming a little. Thanks to you both.

Re: [julia-users] Forming run() calls programatically

2016-05-13 Thread Yichao Yu
On Fri, May 13, 2016 at 8:37 AM, Tom Breloff wrote: > I think this will work: > >> for (fn, arg) = ((:toucha, "a"), (:touchb, "b")) >> cmd = `touch $arg` >> @eval $fn() = run($cmd) I believe `` @eval $fn() = run($`touch $arg`) `` also works >> end > > > > On Fri, May

Re: [julia-users] Forming run() calls programatically

2016-05-13 Thread Tom Breloff
I think this will work: for (fn, arg) = ((:toucha, "a"), (:touchb, "b")) > cmd = `touch $arg` > @eval $fn() = run($cmd) > end On Fri, May 13, 2016 at 7:34 AM, Andrew Gibb wrote: > I'm trying to use metaprogramming to create two functions. Each of which >

[julia-users] Forming run() calls programatically

2016-05-13 Thread Andrew Gibb
I'm trying to use metaprogramming to create two functions. Each of which includes a similar, long, call to run(). The calls are not quite identical. Some flags have different arguments, and some are only present on one call. I can't work out how to get expression interpolation to happen within