Function frequency: Difference between revisions
Content added Content deleted
(→{{header|REXX}}: added/changed whitespace and comments, add aligned numbers via computation of width, made the frequency counter more idiomatic.) |
|||
Line 791: | Line 791: | ||
mouseUp 2</lang> |
mouseUp 2</lang> |
||
=={{header|Mathematica}}== |
=={{header|Mathematica}} / {{header|Wolfram Language}}== |
||
<lang Mathematica>programCount[fn_] := Reverse[If[Length[#] > 10, Take[#, -10], #] &[SortBy[Tally[Cases[DownValues[fn], s_Symbol, \[Infinity], Heads -> True]], Last]]]</lang> |
<lang Mathematica>programCount[fn_] := Reverse[If[Length[#] > 10, Take[#, -10], #] &[SortBy[Tally[Cases[DownValues[fn], s_Symbol, \[Infinity], Heads -> True]], Last]]]</lang> |
||
{{out}}The output of applying this program to itself...<pre>programCount[programCount] |
{{out}}The output of applying this program to itself...<pre>programCount[programCount] |