help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] Easiest way to add new methods to kernel classes (f


From: Lee Duhem
Subject: Re: [Help-smalltalk] Easiest way to add new methods to kernel classes (from within a script)?
Date: Fri, 26 Feb 2010 09:18:45 +0800

On Fri, Feb 26, 2010 at 6:14 AM, Rick Flower <address@hidden> wrote:
> Paolo,
>
> I'd like to add >>asArrayOfSubstrings (found in the Smalltalk
> by Example book) into the CharacterArray class but would like
> it to remain within my script so that I don't modify the kernel
> files directly.. What's the best way to do that?

You can use

someClass extend [
    yourMethod [
        ...
    ]
]

or

someClass class extend [
    yourClassMethod [
        ...
    ]
]

in your script. This is the way I used to do it.

lee




reply via email to

[Prev in Thread] Current Thread [Next in Thread]