Function Repository Resource:

WLMinVersion (1.0.1) current version: 1.1.0 »

Source Notebook

Find what version of the Wolfram Language you need to define a function

Contributed by: Peter Cullen Burbery

ResourceFunction["WLMinVersion"][func]

gives the minimum Wolfram Language version required to evaluate func.

ResourceFunction["WLMinVersion"][ls]

gives the minimum Wolfram Language version required to evaluate functions in the list ls by taking the maximum.

Details

ResourceFunction["WLMinVersion"] uses the resource function SymbolDependencies. This determines the built-in functions used in defining func. Then WolframLanguageData is used to find the most recent version in which one or more of these were introduced.

Examples

Basic Examples (2) 

Define a function:

In[1]:=
OEISLookup[numbers : {__?NumericQ}] := Dataset[MapAt[Map[Association], Key["results"]]@
   Association[
    URLExecute[
     URLBuild[<|"Scheme" -> "https", "User" -> None, "Domain" -> "oeis.org", "Port" -> None, "Path" -> {"", "search"}, "Query" -> {"q" -> StringRiffle[numbers, ","], "fmt" -> "json"}, "Fragment" -> None|>]]]]

Find what version of the Wolfram Language you need to define this function:

In[2]:=
ResourceFunction["WLMinVersion"][OEISLookup]
Out[2]=

Scope (3) 

The function works on lists of defined functions by taking the max:

In[3]:=
randomWordCloud[] := WordCloud[RandomChoice[RandomWord[10], 30]];
randomGraphProduct[{n_, m_}] := GraphProduct[RandomGraph[{n, m}], RandomGraph[{n, m}]];
In[4]:=
ResourceFunction["WLMinVersion", ResourceVersion->"1.0.1"][{randomWordCloud, randomGraphProduct}]
Out[4]=

The function is designed for user-defined functions not in the System` context, but it also works with functions in the System` context.

Find what version is required to use TraditionalForm:

In[5]:=
ResourceFunction["WLMinVersion"][TraditionalForm]
Out[5]=

The functionality is already present in WolframLanguageData:

In[6]:=
WolframLanguageData[ToString[TraditionalForm], "VersionIntroduced"]
Out[6]=

Neat Examples (1) 

Use this function on itself:

In[7]:=
ResourceFunction["WLMinVersion"][
ResourceFunction["WLMinVersion"]]
Out[7]=

Publisher

Peter Burbery

Requirements

Wolfram Language 12.0 (April 2019) or above

Version History

  • 1.1.0 – 22 November 2023
  • 1.0.1 – 21 August 2023
  • 1.0.0 – 14 August 2023

Related Resources

Author Notes

I tried to come up some functions I could use for the example of using the function on a list so I did random word cloud and random graph product.

License Information