Function frequency: Difference between revisions

(Added Racket version)
Line 703:
 
 
=={{header|Perl 6}}==
Here we just examine the ast of the Perl 6 compiler (which is written in Perl 6) to look for function calls.
<lang perl6>my $text = qqx[perl6 --target=ast @*ARGS[]];
my %fun;
for $text.lines {
%fun{$0}++ if / '(call &' (.*?) ')' /
}
 
for %fun.invert.sort.reverse[^10] { .value.say }</lang>
{{out}}
Here we run it on the strand sort RC entry. Note how Perl 6 considers various operators to really be function calls underneath.
<pre>$ ./morefun strand
pop
postcircumfix:<[ ]>
unshift
succeed
splice
prefix:<->
push
infix:<,>
infix:<..>
infix:<-></pre>
=={{header|PicoLisp}}==
<lang PicoLisp>(let Freq NIL
Anonymous user