Here is an example:
if VERSION < v"0.4-"
    typealias AbstractString String
endif



On Sunday, May 24, 2015 at 1:26:19 PM UTC-4, andrew cooke 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