2 ms·
Our use of ' was inspired by lisp's. Immutability such is an important part of Spin's messaging model that we wanted a consistent way to declare an immutable c
by adamb 16y ago
Our use of ' was inspired by lisp's.
Immutability such is an important part of Spin's messaging model that we wanted a consistent way to declare an immutable construction.
# An immutable string (or symbol)
'foo
# An immutable list
'[ 1, 'foo, '[] ]
# An immutable map
'{ foo: 1, y: 'two, z: '[ 'three ] }
Slightly more advanced...
# Also an immutable string
"foo with spaces"
# An immutable pair
"bar" -> 2
# Syntactic sugar for that same pair
bar: 2
# Syntactic sugar for "baz" -> baz
~baz
- adamb 16y agoWhile we're talking about syntax, "\n" is an alternative to ",". This helps multi-line expressions read more naturally. '{ foo: 1 baz: 'bar chunky: 'bacon }