Anonymous user
Function frequency: Difference between revisions
→{{header|Smalltalk}}
Line 1,975:
=={{header|Smalltalk}}==
{{works with|Smalltalk/X}}
This parses all classes of all loaded packages/libraries (takes a few seconds)
<lang smalltalk>bagOfCalls := Bag new.
Line 1,986:
Stdout printCR: e'method {assoc value} is called {assoc key} times.'
].</lang>
note: messagesSent calls the parser for an AST and enumerates the parse nodes; it does not know, which get inlined and which end up being called actually (in fact, most of the one's below are probably inlined).
The results below were printed in scripting mode, where only a small part of the system is actually preloaded.
{{out}}
<pre>method ifTrue:is called 19805 times.
|