Smalltalk examples added
This commit is contained in:
parent
046d0da873
commit
ad11e3bcab
|
@ -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"
|
|
@ -0,0 +1 @@
|
||||||
|
'Hello World!' displayNl
|
|
@ -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'"
|
Loading…
Reference in New Issue