Thanks! 

On Tuesday, May 31, 2016 at 11:24:50 PM UTC+1, Yichao Yu wrote:
>
> On Tue, May 31, 2016 at 6:16 PM, Davide Lasagna <lasagn...@gmail.com 
> <javascript:>> wrote: 
> > Hi, 
> > 
> > How do package developers write code that is specific to different julia 
> > versions? 
> > 
> > For example, is anything like this: 
> > if VERSION < v"0.5-dev" 
> >     f(x) = code_that_runs_on_v0.4() 
> > else 
> >     f(x) = code_that_runs_on_v0.5() 
> > end 
> > recommended or is there a better way? 
>
> If the feature is not available in Compat and can't easily be added, I 
> recommend just add the global branch that depends on julia version. 
> You can always naturally refactor out common code path as you go. 
>
> > 
> > My use case is a generated function that builds SubArrays. Between 
> v0.4.* 
> > and v0.5, the last parameter changed so I need to have code that builds 
> the 
> > correct code in different versions. 
> > 
> > Thanks, 
> > 
> > Davide 
>

Reply via email to