There is this issue, which I think would do what you want:
https://github.com/JuliaLang/julia/issues/7449

On Sun, 2015-05-24 at 19:26, andrew cooke <[email protected]> wrote:
> Julia 0.4 has changed the rand! api (in a good way - the generator is now 
> explicit) and I am wondering whether I can support both in a single code 
> base.
>
> What I'd really like, being old fashioned and simple, is something like 
> cpp's macros that let me switch between two different sets of code:
>
> #ifdef 0.4
> rand!{...}(...) = ...
> #else
> rand!{...}(...) = ...
> #endif
>
> That seems like it would be simple and easy for me to understand and read 
> and maintain in the future.
>
> It also seems like it should be possible with macros, so I wondered if 
> anyone had done so?
>
> (I did look at the Compat package, but it doesn't seem to support this 
> particular issue).
>
> Does anything like this exist?
>
> Thanks,
> Andrew

Reply via email to