Function Repository Resource:

WLMinVersion

Source Notebook

Find what version of 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.

ResourceFunction["WLMinVersion"][func,"Recommended"]

gives the recommended Wolfram Language version required to evaluate func.

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 (3) 

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]=

What version is recommended:

In[3]:=
ResourceFunction["WLMinVersion"][OEISLookup, "Recommended"]
Out[3]=

Scope (3) 

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

In[4]:=
randomWordCloud[] := WordCloud[RandomChoice[RandomWord[10], 30]];
randomGraphProduct[{n_, m_}] := GraphProduct[RandomGraph[{n, m}], RandomGraph[{n, m}]];
In[5]:=
ResourceFunction[
 "WLMinVersion"][{randomWordCloud, randomGraphProduct}]
Out[5]=
In[6]:=
ResourceFunction["WLMinVersion"][#, "Recommended"] & /@ {randomWordCloud, randomGraphProduct}
Out[6]=
In[7]:=
ResourceFunction["WLMinVersion"][#] & /@ {randomWordCloud, randomGraphProduct}
Out[7]=

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[8]:=
ResourceFunction["WLMinVersion"][TraditionalForm]
Out[8]=

The functionality is already present in WolframLanguageData:

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

Neat Examples (1) 

Use this function on itself:

In[10]:=
ResourceFunction["WLMinVersion"][
ResourceFunction["WLMinVersion"]]
Out[10]=
In[11]:=
ResourceFunction["WLMinVersion"][ResourceFunction[
 "WLMinVersion"], "Recommended"]
Out[11]=

Publisher

Peter Burbery

Requirements

Wolfram Language 13.0 (December 2021) 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

This is not meant to encourage updates to the Wolfram Language when updates are not needed. The purpose of this function is so you can determine what is the required version when you are creating a Resource Function. I also like to know what is the minimum, and what is recommended.

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