logo       

Re: invoking a *class* method from a workspace: msg#00149

lang.smalltalk.squeak.beginners

Subject: Re: invoking a *class* method from a workspace

On May 26, 2007, at 14:50 , mstram wrote:

What's the trick / catch ... if there is one for invoking a class method from
a workspace?

"Class methods" in Smalltalk are regular methods, because classes are regular objects. Unfortunately the browser gives the impression that there are two kinds of methods ...

MyClass new

simply sends #new to the object MyClass. This is how you invoke a "class method".

Remember, anything in Smalltalk is an object. Even classes. There is not even a "syntax" to define a class or a method (just like there is no syntax for control structures). Everything is accomplished by sending messages.

- Bert -


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise