"I have a mind like a steel... uh... thingy." Patrick Logan's weblog.

Search This Blog


Tuesday, May 04, 2004

Putting Methods in System Objects

Creating new methods on Object By Sean Malloy

Being able to define new methods on existing library classes is where Smalltalk gets some of its power (Allowing you to create amazingly expressive code

Here's an example: distance := (100 miles + 224 kilometers) asMillimeters. (Try and do that in C# and have it read like that!).

And remember, the methods you add to Object only have to make sense for your application.

No comments:

Blog Archive

About Me

Portland, Oregon, United States
I'm usually writing from my favorite location on the planet, the pacific northwest of the u.s. I write for myself only and unless otherwise specified my posts here should not be taken as representing an official position of my employer. Contact me at my gee mail account, username patrickdlogan.