4 ms·
in scheme, the ' is the syntax for a quote. i'm guessing they use it here as syntax to symbols, but in some of the example code, i see it in front of list-like
by cracki 16y ago
in scheme, the ' is the syntax for a quote. i'm guessing they use it here as syntax to symbols, but in some of the example code, i see it in front of list-like things too...
- adamb 16y agoOur 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 }