Smalltalk examples added

This commit is contained in:
Kolan Sh 2014-03-25 18:26:55 +04:00
parent 046d0da873
commit ad11e3bcab
3 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,7 @@
a := #(1 'hi' 3.14 1 2 (4 5))
(a at: 3) displayNl "3.14"
(a reverse) displayNl "((4 5) 2 1 3.14 'hi' 1)"
(a asSet) displayNl "Set(1 'hi' 3.14 2 (4 5))"
.
hash := Dictionary from: { 'water' -> 'wet'. 'fire' -> 'hot' }.
hash at: 'fire' displayNl "Prints: hot"

View File

@ -0,0 +1 @@
'Hello World!' displayNl

View File

@ -0,0 +1,5 @@
"Everything, including a literal, is an object, so this works:"
-199 abs displayNl "199"
'gst is cool' size displayNl "11"
( 'Slick' indexOf: $c ) displayNl "4"
'Nice Day Isn''t It?' asLowercase asSet asSortedCollection asString displayNl "' '?acdeinsty'"