Introduction to Smalltalk - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

Introduction to Smalltalk

Description:

History of Smalltalk ... (Xerox PARC): Smalltalk-72 Smalltalk-76 Smalltalk-80 ... Mature class library and tools Virtual machine Objects exist in a ... – PowerPoint PPT presentation

Number of Views:241
Avg rating:3.0/5.0
Slides: 13
Provided by: Compute130
Category:

less

Transcript and Presenter's Notes

Title: Introduction to Smalltalk


1
Introduction to Smalltalk
  • History of Smalltalk
  • The philosophy of Smalltalk
  • ...we have a universe of well-behaved objects
    that courteously ask each other to carry out
    their various desires. Dan Ingalls, Byte
    81.
  • Basic notions
  • Class and instance
  • Message and method
  • Some Smalltalk programs
  • The class library
  • Objectives
  • To mentally prepare for the next lecture...
  • Read Smalltalk.
  • To be able to write Smalltalk code.

2
Historical Background
Lisp
1960
Algol 60
Simula 67
1970
Smalltalk-72
Pascal
Smalltalk-74
Smalltalk-76
C
Flavors
Smalltalk-78
LOOPS
1980
Smalltalk-80
Common Lisp
Clascal
C86
Ada
Common Loops
New Flavors
Object Pascal
C with classes
Little Smalltalk
Quick Pascal
Turbo Pascal
CLOS
1990
Squeak
ANSI C
3
Smalltalk History
  • Developed at the Xerox Palo Alto Research Center
    (Xerox PARC)
  • Smalltalk-72
  • Smalltalk-76
  • Smalltalk-80
  • Originally intended for children. Ideas from
  • Simula-67
  • Lisp
  • Logo
  • Xerox pioneer ideas fumbled by the company
  • Smalltalk
  • GUI
  • PostScript

4
Smalltalk Versions
  • Smalltalk-80 product of ParcPlace. UNIX, Mac,
    MS-DOS.
  • ObjectWorks
  • VisualWorks
  • Smalltalk/V product of Digitalk. MS-DOS,
    Windows, OS/2, Mac.
  • Gnu Smalltalk X based GUI. Compatible with
    Smalltalk-80. Still under development. UNIX.
    Free.
  • VisualAge product of IBM. OS/2, Windows.
  • Squeak
  • Started at Apple, continued at Walt Disney
    Imagineering
  • Derived directly from Smalltalk-80
  • Free, open source
  • Goals
  • Portable
  • Written in Smalltalk

5
Squeak in Our Course
  • Squeak installed on
  • SSDL Lab
  • Can be downloaded from
  • http//www.squeak.org/
  • Versions
  • Windows
  • Linux
  • Read all about it in the Assignment

Yes, it is legal to download it and work at home!
No, we will not give technical support for those
who wish to work at home!
6
Why Squeak?
  • Pure object-oriented language and environment
  • Everything is an object
  • Language and environment
  • Class browser, debugger, inspector,
  • Mature class library and tools
  • Virtual machine
  • Objects exist in a persistent image changes
  • Portable Compile once, run everywhere
  • Open-source, implemented in Smalltalk
  • Based on original Smalltalk-80 code

7
Squeak by Example
  • www.SqueakByExample.org
  • Free PDF download

8
A Question
  • What is the result of the Smalltalk expression
  • 1 2 3
  • Answer 9 ( Why?!? )
  • In Smalltalk, 1 is an object. We sent it a
    message with selector and argument 2. The
    response to this message is the object 3. Then, 3
    receives the message with argument 3 and
    responds 9.
  • The objects 1, 2 and 3 know how to respond to
    messages like and , since they are all integer
    numbers.
  • In Smalltalk, we say that 1, 2 and 3 are
    instances of the class SmallInteger.

Each object is an instance of a class.
9
In Smalltalk, everything is an object
  • There is no way to create an entity that is not
    an object.
  • Every object contains a small amount of memory
    instance variables.
  • Only the object can access its memory.
  • An objects memory can contain only other
    objects.
  • Computation send messages to objects.
  • Objects have methods what to do when messages
    are received.
  • Each object is a member of exactly one class.
  • Classes are organized in an inheritance tree.
  • Multiple inheritance only in very specialised
    versions.

10
Class Library
  • Smalltalk core is
  • simple
  • minimal syntax
  • The language lives and dies by its class library.
  • Different in every implementation and in every
    version.
  • Almost always includes
  • Boolean
  • Numbers integers, floating, ...
  • Strings
  • Collections sets, bags, arrays, lists, search
    tables ...
  • (User interface)
  • Can be subclassed by user.

11
Bon
  • Business Object Notation
  • AKA Better Object Notation
  • Inventors
  • Jean-Marc Nerson and Kim Walden (1995)
  • Legend (partial)

Class
Object
AbstractClass
Inheritance
12
Squeak Class Library
This is only a partial view
ProtoObject
Object
Boolean
Collection
Magnitude
Character
Set
SequenceableCollection
Number
False
True
Dictionary
ArrayedCollection
false
Float
true
Integer
String
Array
Write a Comment
User Comments (0)
About PowerShow.com