[Newbies] add method from Workspace?

Travis Kay tlk at nb.sympatico.ca
Sun Oct 21 06:16:47 UTC 2007


Don,

Open the message names browser and search for compile: . You'll most 
likely find the methods compile: , compile:classified: and 
compile:in:classified: most interesting. As a quick example, execute the 
code below in a workspace, it will add the instances method myMethod to 
the String class in the category 'complie-example'.

String compile: ' myMethod ^ ''testing'' ' classified: 'compile-example' .

Note that you will have to escape quotes... I hope this helps.

Travis

Don McLane wrote:
> How can I add a method to a class from the workspace?  Adding a class is
> easy, just send a message to the superclass.  FileIn does it all the
> time, but I can't seem to do it with any variation of the format in a
> .st file.
>
> For the curious: the reason I want to do this is to make a classroom
> demonstration go more smoothly.
>
> Thanks,
> Don McLane
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
>   



More information about the Beginners mailing list