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 codeAnd remember, the methods you add to Object only have to make sense for your application.Here's an example: distance := (100 miles + 224 kilometers) asMillimeters. (Try and do that in C# and have it read like that!).
No comments:
Post a Comment