Hello

Stephane Ducasse ducasse at iam.unibe.ch
Sun May 18 08:42:00 UTC 2003


Hi

dominic I suggest you to read the free book available on my web page:
Smalltalk by example then after Kent Beck Best Smalltalk practices
Online Free Books at 
http://www.iam.unibe.ch/~ducasse/WebPages/FreeBooks.html

Free books for Universities at 
http://www.esug.org/sponsoring/promotionProgram.html

Stef


On Sunday, May 18, 2003, at 01:27 AM, Dominic Fox wrote:

> Hi,
>
> I'm a Squeak/Smalltalk newbie with some experience of doing OO in other
> languages, chiefly VB (which is not at all great for that purpose) and 
> Python
> (which is rather better, but not in use in my place of work), and a
> smattering of FP that's still not settled in my mind. I'm trying to 
> get my
> head round a couple of things in Smalltalk, and the documentation I've
> browsed so far hasn't helped much: my queries more to do with idiom 
> than
> anything else. Can anyone give me a clue as to where I might find some
> answers to questions like these:
>
> * If I want to expose an instance's private fields, do I have to code 
> accessor
> methods every time? Is there an alternative to writing
>
> getFoo
> 	^ foo
>
> and
>
> setFoo: newFoo
> 	foo := newFoo
>
> over and over again?
>
> * Is the best way to make what in C++ or Java you'd call 
> "constructors" to
> write class methods that create, initialize and then return an 
> instance, e.g.
>
> newFooWithBar: initialBar
> 	| newFoo |
> 	newFoo := Foo new; setBar: initialBar.
> 	^ newFoo
>
> or is there a more concise way?
>
> * Can I treat blocks as first-class entities, e.g. return them from 
> methods,
> pass them around etc? Can I use them to implement LISP-like closures? 
> Even if
> I can, is this a "natural" smalltalky way to do things?
>
> * What about function/method pointers? Can I treat one of an instance's
> methods as a block, or do I have to make a new block and call the 
> method
> inside that?
>
> Finally,
>
> * Is this list a good place to ask questions like this? If it isn't, 
> is there
> a more suitable one?
>
> thanks,
> Dominic
>
>
>
Prof. Dr. Stephane DUCASSE  	[ | ]
http://www.iam.unibe.ch/~ducasse/
  "if you knew today was your last day on earth, what would you
  do different? ...  especially if,  by doing something different,
  today might not be your last day on earth" Calvin&Hobbes




More information about the Squeak-dev mailing list