~ Office Supplies ~~ Buy Posters ~~ A-Z Products ~~ Website Advertising


Smalltalk programming language - Wikipedia

<<Up     Contents

Smalltalk programming language

Redirected from Smalltalk

Smalltalk is a dynamically typed object oriented programming language designed at Xerox PARC by Adele Goldberg, Dan Ingalls[?], Alan Kay, Ted Kaehler[?] and others during the 1970s. The language was generally released as Smalltalk-80 and has been widely used since.

In spite of its 20-year history, it is widely believed that the overall programming experience and productivity of Smalltalk is still unsurpassed by other development environments. Smalltalk is in continuing active development, and has gathered a loyal community of users around it.

Smalltalk has been had a great influence on the development of many other computer languages, including: Objective-C, Actor, Java and Ruby. Many software development ideas of the 1990s came from the Smalltalk community, such as Design Patterns (as applied to software), Extreme Programming and Refactoring. Among Smalltalkers is Ward Cunningham, the inventor of the WikiWiki concept.

Smalltalk's big ideas include:

The following code example for finding the vowels in a string illustrates Smalltalk's style. ( | characters declare variables, : declares parameters, and think of [ and ] as { and } curly braces for the moment):

| aString vowels |
aString := 'This is a string'.
vowels := aString select: [:aCharacter | aCharacter isVowel].
In the last line, the string is sent a select: message with the code block following as an argument. Here's the code in the superclass Collection that does the work:
| newCollection |
newCollection := self species new.
self do: [:each | 
    (aBlock value: each) 
        ifTrue: [newCollection add: each]].
^newCollection
It responds to the message by iterating through its members (this is the do: method) evaluating aBlock code once for each character; aBlock (aCharacter isVowel) when evaluated creates a boolean, which is then sent ifTrue:. If the boolean is true, the character is added to a string to be returned. Because select is defined in the abstract class Collection, we can also use it like this:
| rectangles aPoint|
rectangles := OrderedCollection 
  with: (Rectangle left: 0 right: 10 top: 100 bottom: 200)
  with: (Rectangle left: 10 right: 10 top: 110 bottom: 210).
aPoint := Point x: 20 y: 20.
collisions := rectangles select: [:aRect | aRect containsPoint: aPoint].

External Links

Implementations

Tutorials

wikipedia.org dumped 2003-03-17 with terodump




 
 
Orange Mexican Potch OPAL gem stone jewel Loose faceted cut jewelry gemstone 8x6 mm single 8x6mm ov
 Orange Mexican Potch OPAL jewel Loose ed cut jewelry 8x6 mm single 8x6mm ov 
 
100 ctw unknown RED GARNETS gem stones Faceting cabbing rough crystal Tiny melee accent up to 2 ct
 100 ctw unknown RED GARNETS ing cabbing crystal Tiny melee accent up to 2 ct 
 
SS .925 Sterling Silver 18" inch box chain 1 mm for gemstone jewelry pendant necklace spring clasp
 SS .925 Sterling Silver 18" inch box chain 1 mm for jewelry pendant necklace spring clasp 
 
28 carats cts Tigereye yellow gold TigerIron Jasper gem tumble polished Cabbing cab tiger iron rough
 28 carats cts Tigereye yellow gold TigerIron Jasper tumble polished Cabbing cab tiger iron  
 
Red green AMMOLITE gem stone Freeform cabochon cabbing jewelry rough Ammonite opal 10 carats 2 grams
 Red green AMMOLITE Freeform cabochon cabbing jewelry Ammonite opal 10 carats 2 grams