About this Book
Squeak is a modern open-source development environment for the classic Smalltalk-80 programming language. Despite being the first purely object-oriented language and environment, Smalltalk is in many ways still far ahead of its successors in promoting a vision of an environment where everything is an object, and anything can change at run-time.
Squeak by Example, intended for both students and developers, will guide you gently through the Squeak language and environment by means of a series of examples and exercises.
This book is made available under the Creative Commons Attribution-ShareAlike 3.0 license. You can either download the PDF for free, or you can buy a softcover copy from lulu.com. (You can also pay for the PDF download from lulu.com, if you would like to make a contribution to this effort, but you are under no obligation.)
Topics
The book helps you get started with A Quick Tour of Squeak and guides you through A First Application. The Smalltalk language is introduced in three chapters on Syntax in a Nutshell, Understanding Message Syntax and The Smalltalk Object Model.
Development with Squeak is covered in The Squeak Programming Environment and SUnit. Several of the key classes are presented in chapters on Basic Classes, Collections, Streams and Morphic.
The first edition of the book concludes with chapters on Classes and Metaclasses and Frequently Asked Questions.
An Open Book
This book is open in the following senses:
- The full book is available as a free, printable PDF download.
- You can also order a print-on-demand, softcover copy of the book.
You can also pay for the PDF from the same web site, if you like, but you are under no obligation! (We are happy if you would like to make a contribution.) - The content of this book is released under a Creative Commons Attribution-ShareAlike license. In short, you are allowed to freely share and adapt this book, as long as you respect the conditions of the license. You may download the LaTeX sources from the publicly-accessible subversion repository.
- Source code of various projects described in the book is available as open-source from SqueakSource.
We would like to see this book grow! We encourage you to contribute chapters on the parts of Squeak that we have not described. If you would like to participate, please contact us.
Hands On!
The book is filled with hands-on exercises for you to try out.
Wherever possible, Smalltalk code is illustrated with lots of working examples.
factorial := [:n | (1 to: n) inject: 1 into: [:product :each | product * each ] ]. factorial value: 10 → 3628800
Truth in Advertising
Actually, most of the examples are automatically converted to SUnit tests, so we can be sure that the code really runs as advertised. For example, the following expression (on line 114 of the Preface)
3 + 4 → 7
will be translated to:
test114 self assert: [ 3 + 4 ] value printString = '7'.
and automatically run:
Resources
- Buy the book from Amazon or Lulu
- Download latest version
- (304 pp., 3.5MB pdf)
- Creative commons by-sa license
- Source code (SqueakSource)
- errata
- LaTeX sources (github)
- bibtex reference
- Discussion list and archive
Download
- Squeak Downloads (I would suggest v3.9.1 unless you wish to assemble v3.10)
- Squeak By Example Image File (This zip file contains the image, changes and V39 sources file)