Spry vs Smalltalk #

Spry is a functional language with OO mechanisms and syntax that makes it feel very close to Smalltalk.

Let's translate a few snippets of Smalltalk code to Spry.

Smalltalk:

| a b |
a := 5.
b := a + 1.
^b

Spry:

a = 5
b = (a + 1)
^b
Smalltalk Spry Comment
"a comment" # a comment
'abc' "abc"
$x Spry does not have Characters yet.
#foo 'foo Symbols are called Literal Words
#(1 2 3) [1 2 3]
x := 3 + 4. x = (3 + 4) In Spry parentheses are needed since there are no statement separators.
[:x | x + 1] [:x + 1] In Spry :x is an operation, not a declaration.
OrderedCollection with: 1 with: 2 [1 2] Spry blocks are used for all sequences.
MyClass new object [MyClass] {}
{1 + 2. 2 + 3} reduce [(1 + 2) (2 + 3)]