Hi Squeakers,
I have been reading Adele Goldberg's classic text, "Smalltalk-80 The Interactive Programming Environment," and came across this in Chapter 7, "How to make Pictures." Adele states, "Create a Form Editor by evaluating an expression of the form, (Form new extent: 300 @ 400) edit" It didn't work for me in Squeak 3.8 (on my Macintosh). Further down, Adele says, "The message edit can be sent to any instance of Form." But when I checked with my browser I found that Form has a class method extent: but not an instance method extent:. So I tried (Form extent: 300 @ 400) edit and the Form Editor appeared as desired. Is this because Smalltalk and Squeak are different somehow, or is there a mistake in the text, or? If the text is correct, then I still don't fully appreciate the difference between class and instance methods. Bruce Prior (still looking for "ah - ha!" and I think it's close....) _______________________________________________ Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners |
instance methods are sent to objects:
(10@100) x x is an instance method sent to a point @ is an instance method sent to 10 Now have a look at the class side (press the button class) on the class Form apparently there is a method extent: aPoint This method is a method that will be executed when a class receives the message extent: Not that conceptually Form new extent: aPoint apparently there is no instance method name extent: but if you try (Form new setExtent: 100@100 depth: 1) you will get a form but set* may indicate that this is a method that you should not direcly invoke (as explained in the book of Beck or Smalltalk by Example) Stef On 5 janv. 07, at 05:56, Bruce Prior wrote: > Hi Squeakers, > > I have been reading Adele Goldberg's classic text, "Smalltalk-80 > The Interactive Programming Environment," and came across this in > Chapter 7, "How to make Pictures." > > Adele states, "Create a Form Editor by evaluating an expression of > the form, > > (Form new extent: 300 @ 400) edit" > > It didn't work for me in Squeak 3.8 (on my Macintosh). > > Further down, Adele says, "The message edit can be sent to any > instance of Form." But when I checked with my browser I found that > Form has a class method extent: but not an instance method extent:. > > So I tried (Form extent: 300 @ 400) edit and the Form Editor > appeared as desired. Is this because Smalltalk and Squeak are > different somehow, or is there a mistake in the text, or? Squeak has 26 years more :) > If the text is correct, then I still don't fully appreciate the > difference between class and instance methods. > > Bruce Prior (still looking for "ah - ha!" and I think it's close....) > > _______________________________________________ > Beginners mailing list > [hidden email] > http://lists.squeakfoundation.org/mailman/listinfo/beginners > _______________________________________________ Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners |
In reply to this post by bprior
On 05.01.2007, at 05:56, Bruce Prior wrote: > Hi Squeakers, > > I have been reading Adele Goldberg's classic text, "Smalltalk-80 > The Interactive Programming Environment," and came across this in > Chapter 7, "How to make Pictures." > ..... > Further down, Adele says, "The message edit can be sent to any > instance of Form." But when I checked with my browser I found that > Form has a class method extent: but not an instance method extent:. > > So I tried (Form extent: 300 @ 400) edit and the Form Editor > appeared as desired. Is this because Smalltalk and Squeak are > different somehow, or is there a mistake in the text, or? > The Smalltalk as documented in Adele's books is a very old version. A lot has changed. Forms, for example, have been extended to support color. And the interface for instance creation has been changed, as you have seen. In general, the goal of Squeak was (should be, used to be) not to re- create a 100% Smalltalk-80 compatible system, but to transcend Smalltalk... sadly not much has been archieved, and the sytem even contains a lot of the old MVC code that is not used anymore (and slightly broken in many cases, as code not used rots). The Form editor, for example, seems to only work in MVC and not Morphic. Marcus _______________________________________________ Beginners mailing list [hidden email] http://lists.squeakfoundation.org/mailman/listinfo/beginners |
Free forum by Nabble | Edit this page |