Function frequency: Difference between revisions

Content added Content deleted
(Created draft task)
 
(Added PicoLisp)
Line 4: Line 4:
This is a static analysis: The question is not how often each function is
This is a static analysis: The question is not how often each function is
actually executed at runtime, but how often it is used by the programmer.
actually executed at runtime, but how often it is used by the programmer.

=={{header|PicoLisp}}==
<lang PicoLisp>(let Freq NIL
(for "L" (filter pair (extract getd (all)))
(for "F"
(filter atom
(fish '((X) (or (circ? X) (getd X)))
"L" ) )
(accu 'Freq "F" 1) ) )
(for X (head 10 (flip (by cdr sort Freq)))
(tab (-7 4) (car X) (cdr X)) ) )</lang>
Output:
<pre>quote 310
car 236
cdr 181
setq 148
let 136
if 127
and 124
cons 110
cadr 80
or 76</pre>