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

Print | posted on Thursday, May 10, 2007 10:59 PM

Feedback


Gravatar

# re: Booish fun 5/10/2007 11:21 PM Eugen Anghel

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


Gravatar

# re: Booish fun 5/10/2007 11:59 PM Ayende Rahien

Didn't think of it :-(


Gravatar

# re: Booish fun 5/11/2007 3:41 AM 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.