diff --git a/smalltalk/helloworld/collections.st b/smalltalk/helloworld/collections.st new file mode 100644 index 0000000..6413900 --- /dev/null +++ b/smalltalk/helloworld/collections.st @@ -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" diff --git a/smalltalk/helloworld/helloworld.st b/smalltalk/helloworld/helloworld.st new file mode 100644 index 0000000..74bf95e --- /dev/null +++ b/smalltalk/helloworld/helloworld.st @@ -0,0 +1 @@ +'Hello World!' displayNl diff --git a/smalltalk/helloworld/somebasic.st b/smalltalk/helloworld/somebasic.st new file mode 100644 index 0000000..115625f --- /dev/null +++ b/smalltalk/helloworld/somebasic.st @@ -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'"