https://github.com/JuliaLang/julia/issues/7449
https://github.com/JuliaLang/Compat.jl/pull/131
https://github.com/JuliaLang/julia/issues/5892

On Thu, Nov 12, 2015 at 7:23 AM, andrew cooke <and...@acooke.org> wrote:
>
> when you're writing code that uses macros, supporting different versions of
> julia seems to be more complex than normal.  in particular, things like:
>
> if VERSION > XX
>     # code with macros here
> end
>
> don't work as expected, because macro expansion occurs before runtime
> evaluation.  so the macros are expenaded whatever version.
>
> given that, i have found this simple macro to be useful;
>
> macro cond(test, block)
>     if eval(test)
>         block
>     end
> end
>
> @cond VERSION >= v"0.4" begin
>      # code with macros here
> end
>
> anyway, my questions are: (1) is the above sensible and (2) does this
> already exist?
>
> thanks,
> andrew
>

Reply via email to