MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Package File for Different Mathematica Versions



Hi Andrew

one way would be:

myFunction[ args_ ] /; $VersionNumber >= 6 := Module[
{},
args + 1
]

You can refine that by using the $ReleaseNumber

Oliver
On Tue, 24 Jun 2008, Andrew Beveridge wrote:

> I am writing a package file for Mathematica. I have two versions of
> Mathematica targeted: 5.2 and 6.0.x.
>
> It would be nice to use some of the improvements in Version 6.0.x
> without losing backwards compatibility with Version 5.2.
>
> I imagine one way to implement this would be the following:
>
> If $VersionNumber >= 6 then ... else ...
>
> However, I would prefer not to put a bunch of If statements into my
> code; multiple lines would have to be modified. Is there are more
> elegant way around this problem? Can a function be defined for a
> particular versions of Mathematica in a package file?
>
> Thanks again for all of your help.
>
> Regards,
> Andrew
>
> Andrew C Beveridge
> MS M888
> Los Alamos National Laboratory
> Los Alamos, NM  87545
>
> 505-665-2092
> e-mail: acbev at lanl.gov
>

Oliver Ruebenkoenig, <ruebenko AT uni-freiburg.de>


  • Prev by Date: Timing out while waiting for Manipulate code to load
  • Next by Date: Re: Ploting integral curves
  • Previous by thread: Re: Re: Package File for Different Mathematica Versions
  • Next by thread: Re: Re: Package File for Different Mathematica Versions