Introduction to Squeak?

Andreas Raab andreas.raab at gmx.de
Sat Mar 29 19:29:56 UTC 2003


Hi Jen,

Looks like I'm not the best person to answer your questions as I'm not big
in Celeste/Networking/Protocols etc. But let me try to answer those things I
can:

> Is it not typical to put comments in classes so that one 
> knows what they do?

Well, yes and no. It is not "typical" but it should be encouraged wherever
possible. There have been various discussions about how to make this process
easier but so far, no actions have been taken.

> Is it generally the case that to find out how to use a class you 
> just read through the code?  The thing I'm exploring right now is 
> Celeste, since I have an interest in e-mail programs (as in I'm 
> frustrated with all of them).

Best thing to do is to a) look at the code (and its comments) b) check if
there's some information on the Squeak wiki and c) ask your questions
directly. Note that much of the relations between classes and messages can
be found out by using the "cross-referencing" tools in Squeak. You should
really try to get proficient at these since they reveal much about where,
how, and when things are used. For example:

a) type in a message selector and hit Alt-m - this will give you all the
iMplementors of that message (the same can be obtained from the browser's
message list menu choosing "implementors of...")
b) type in a message selector and hit Alt-n - this will give you all the
seNders of some message (the same from the browser's message list menu
choosing "senders of...")
c) type in a *partial* message selector and hit Alt-W (Alt-Shift-w) - this
gives you a list of messages with matching names and their implementors
d) type in a class name and hit Alt-b - this gives you a class browser on
the class
e) type in a class name and hit Alt-N (Alt-Shift-N) - this gives you a list
of all messages that use this class (the same from the browser's class list
using "class refs")

With the above five commands you can explore 90% of Squeak quite
efficiently. For example, let's take Celeste's CategoriesFile. Using e)
tells us that only MailDB's openDB message uses this. Checking MailDB's
class refs tells us that it's used by Celeste's openDefaultDatabase - so it
all looks as if MailDB is the database for Celeste. In this method we also
see that there's a message called #openOnDatabase: - let's try to find out
if there are any other senders using technique b) (double-click
openOnDatabase: and hit Alt-n). Etc.

> I used SqueakMap to install SUnit 3.1.

Can't really comment on this as I'm neither an expert in SqueakMap nor in
the SUnit packages.

> I noticed that when I was downloading mail into Celeste that I wasn't
> able to do anything else.  Is this because Squeak is not by nature 
> multi-threaded/multi-processing?

Certainly not. Squeak is perfectly multi-thread capable (in fact there are
always multiple threads - called Processes in Squeak - running); if you are
curios about them open a ProcessBrowser (it's in the "tools" flap). I think
whoever wrote this was just tired of issues like locking, synchronization
etc.

Cheers,
  - Andreas


> -----Original Message-----
> From: squeak-dev-bounces at lists.squeakfoundation.org 
> [mailto:squeak-dev-bounces at lists.squeakfoundation.org] On 
> Behalf Of jennyw
> Sent: Saturday, March 29, 2003 8:01 PM
> To: The general-purpose Squeak developers list
> Subject: Re: Introduction to Squeak?
> 
> 
> Hi, Andreas,
> 
> I'm also reading through the FAQ and links to intros on the 
> Swiki, which
> is helpful.  I do have some questions to start out with ...
> 
> Is it not typical to put comments in classes so that one 
> knows what they 
> do?  Is it generally the case that to find out how to use a class you 
> just read through the code?  The thing I'm exploring right now is 
> Celeste, since I have an interest in e-mail programs (as in I'm 
> frustrated with all of them).
> 
> I used SqueakMap to install SUnit 3.1.  I noticed that as I installed 
> packages, they disappeared off the list.  Does this mean that 
> there is 
> no uninstall facility?  I did notice that SUnit had two 
> packages to load 
> for uninstalling.  I assume that loading these removed code.  
> I guess I 
> was originally thinking this would be similar to Debian's 
> apt-get, but 
> it seems to be a bit simpler.
> 
> I noticed that when I was downloading mail into Celeste that I wasn't
> able to do anything else.  Is this because Squeak is not by nature 
> multi-threaded/multi-processing?
> 
> FYI, the project I originally had in mind was to do some basic IMAP
> manipulation.  I do this a bit from Perl and thought it would 
> be nice to
> do this from Squeak. I'm beginning to realize this may be a bit
> difficult since there doesn't seem to be any IMAP support in Squeak. 
> When I asked about this a while ago, Les Tyrrell mentioned that he had
> written some IMAP stuff for VisualWorks that could be ported. 
> However, I
> can't find that package any longer -- it seems his Web pages are no
> longer up.  So if I go ahead with this, this would probably be from
> scratch (although I would be able to use IMAP modules from other
> languages like Python and Perl for ideas).
> 
> Thanks!
> 
> Jen
> 
> On Sat, Mar 29, 2003 at 12:08:55AM +0100, Andreas Raab wrote:
> > Hi Jen,
> > 
> > It depends a little bit on what exactly you want to do but 
> Mark's books
> > would still be my first recommendation. Even though some 
> parts may be a
> > little outdated by now (not very many actually) it will 
> give you a very good
> > idea about how to build things with Squeak. I'd actually 
> use it with the
> > Squeak version which is on the CDs - this will make sure 
> that it ought to
> > work. In fact, those versions might be sufficient for what 
> you're planning
> > (as I don't know what your project is about). If not, it 
> would probably be
> > best to ask for help on this list - people are pretty quick 
> with answers and
> > generally very friendly here.
> > 
> > And by the way, if you are looking for general information about the
> > language and OOP in general, be sure to check out Stef's 
> collection of free
> > books about Smalltalk
> > (http://www.iam.unibe.ch/~ducasse/WebPages/FreeBooks.html) 
> - even if they're
> > not discussing the latest technology in Squeak some of them 
> are excellent
> > books on general programming issues (and they only cost you 
> download time ;)
> > 
> > Good luck!
> >   - Andreas
> 



More information about the Squeak-dev mailing list