Ayende @ Rahien

Unnatural acts on source code

Booish fun

Booish is a command interpreter for the Boo language, this means that it gives you the full power of Boo and the .NET framework at your finger tips.

I just needed to find the number of methods in mscorlib:

import System.Reflection

mscorlib = typeof(object).Assembly

methodCount = 0

typeCount = 0

for t in mscorlib.GetTypes():

      typeCount +=1

      for m in t.GetMethods():

            methodCount += 1

print "Types ${typeCount}, Methods: ${methodCount}"

The result:

Types 2319, Methods: 27650

Comments

Eugen Anghel
05/10/2007 08:21 PM by
Eugen Anghel

Why not methodCount += t.GetMethods().Length ? :)

Tomas Restrepo
05/11/2007 12:41 AM by
Tomas Restrepo

Something I didn't expect: mscorlib in vista returns a different value

Types 2318, Methods 27677

Comments have been closed on this topic.