#390 Open class

johnnycbad Mon 3 Nov 2008

Hi,

Is there a way to open up built-in classes like in Ruby to add methods?

brian Mon 3 Nov 2008

Not right now. Since Fan classes compile into true Java and .NET classes, we won't ever support Ruby style monkey patching. Then again since they are static Java/.NET classes we also get high performance. If we do anything it would probably be more like C# extension methods.

Also see Dynamic Types which really are runtime types where you can add fields and methods at runtime (this is how the sql API works).

Also please let us know if think there are missing methods on common built-in classes which are generally useful.

Login or Signup to reply.