# Smalltalk Bar Camp Hanoi 2009

## by Stinckwich Serge

• 1,665 views

A short introduction to Smalltalk during Bar Camp Hanoi 2009. I use some slides of Alexandre Bergel for this presentation....

A short introduction to Smalltalk during Bar Camp Hanoi 2009. I use some slides of Alexandre Bergel for this presentation.

### Statistics

Likes
0
10
0
Embed Views
1
Views on SlideShare
1,664
Total Views
1,665

## Smalltalk Bar Camp Hanoi 2009Presentation Transcript

• Smalltalk Serge Stinckwich (Serge.Stinckwich@esug.org)
• The origin of Smalltalk Alan Kay’s Dynabook project (1968) Alto —!Xerox PARC (1973)
• Smalltalk today
• Smalltalk today
• Smalltalk today
• Smalltalk today
• Smalltalk today
• Getting started
• Everything is an object
• Everything happens by sending messages
• Running Squeak
• Do it, print it You can evaluate any expression anywhere in Smalltalk
• Standard development tools
• Debuggers, Inspectors, Explorers
• Syntax in a Nutshell
• Three kind of messages 5 factorial Unary messages Transcript cr Binary messages 3+4 Keyword messages 3 raisedTo: 10 modulo: 5 Transcript show: 'hello world'
• A typical method in the class Point Method name Argument Comment <= aPoint ! quot;Answer whether the receiver is neither ! below nor to the right of aPoint.quot; ! ^ x <= aPoint x and: [y <= aPoint y] Return Block Binary message Instance variable Keyword message (2@3) <= (5@6) true
• Statements and cascades Temporary variables Statement | p pen | p := 100@100. pen := Pen new. pen up. pen goto: p; down; goto: p+p Cascade
• Control structures Every control structure is realized by message sends 4 timesRepeat: [Beeper beep] max: aNumber ! ^ self < aNumber ! ! ifTrue: [aNumber] ! ! ifFalse: [self]
• Control structures Every control structure is realized by message sends 4 timesRepeat: [Beeper beep] Boolean ifTrue:ifFalse: max: aNumber True False ifTrue:ifFalse: ifTrue:ifFalse: ! ^ self < aNumber ! ! ifTrue: [aNumber] ! ! ifFalse: [self] ifTrue: t ifFalse: f ifTrue: t ifFalse: f ^ t value ^ f value
• Creating classes Send a message to a class (!) Number subclass: #Complex ! instanceVariableNames: 'real imaginary' ! classVariableNames: '' ! poolDictionaries: '' ! category: 'ComplexNumbers'
• Smalltalk ressources • Mailing-list : http:// lists.squeakfoundation.org/mailman/listinfo/ smalltalk-vn • Smalltalk ﬂyer translated in Vietnamese • http://community.ofset.org/wiki/Squeak