Smalltalk Bar Camp Hanoi 2009

1,619 views

Published on

A short introduction to Smalltalk during Bar Camp Hanoi 2009. I use some slides of Alexandre Bergel for this presentation.
I you want to more information about Smalltalk in Vietnam, you can contact me.

Published in: Technology, Education
  • Be the first to comment

  • Be the first to like this

Smalltalk Bar Camp Hanoi 2009

  1. 1. Smalltalk Serge Stinckwich (Serge.Stinckwich@esug.org)
  2. 2. The origin of Smalltalk Alan Kay’s Dynabook project (1968) Alto —!Xerox PARC (1973)
  3. 3. Smalltalk today
  4. 4. Smalltalk today
  5. 5. Smalltalk today
  6. 6. Smalltalk today
  7. 7. Smalltalk today
  8. 8. Squeak resources www.squeak.org www.seaside.st Downloads and links One-click image SqueakByExample.org Free download — Print-on-demand
  9. 9. Getting started
  10. 10. Everything is an object
  11. 11. Everything happens by sending messages
  12. 12. Running Squeak
  13. 13. Do it, print it You can evaluate any expression anywhere in Smalltalk
  14. 14. Standard development tools
  15. 15. Debuggers, Inspectors, Explorers
  16. 16. Syntax in a Nutshell
  17. 17. 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'
  18. 18. 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
  19. 19. Statements and cascades Temporary variables Statement | p pen | p := 100@100. pen := Pen new. pen up. pen goto: p; down; goto: p+p Cascade
  20. 20. Control structures Every control structure is realized by message sends 4 timesRepeat: [Beeper beep] max: aNumber ! ^ self < aNumber ! ! ifTrue: [aNumber] ! ! ifFalse: [self]
  21. 21. 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
  22. 22. Creating classes Send a message to a class (!) Number subclass: #Complex ! instanceVariableNames: 'real imaginary' ! classVariableNames: '' ! poolDictionaries: '' ! category: 'ComplexNumbers'
  23. 23. Smalltalk ressources • Mailing-list : http:// lists.squeakfoundation.org/mailman/listinfo/ smalltalk-vn • Smalltalk flyer translated in Vietnamese • http://community.ofset.org/wiki/Squeak

×