Technically, any Turing-complete language can be mapped to any other Turing complete language, so it’s possible to have non-trivial syntatic sugar do anything. (Use brainfuck as IR, lol.) >:) But yeah, SS is more like:<p><pre><code> ++x; // x = x + 1
</code></pre>
Nifty syntax<p><pre><code> &:foo Ruby method name to callable syntax
foo&.bar Ruby check nil before calling bar
foo?.bar Swift optional presence check
if(x = foo!.bar!) {
x.something()
}
foo ?? bar Swift nil-coalescing
foo || bar Ruby nil-coalescing
<<1,4,8,45>> Erlang bit syntax (binary literals), with typing and endianess
5b432140 Erlang arbitrary base literals
List comprehensions Erlang, Python,
Binary comprehensions in Erlang
2> Pixels = <<213,45,132,64,76,32,76,0,0,234,32,15>>.
<<213,45,132,64,76,32,76,0,0,234,32,15>>
3> RGB = [ {R,G,B} || <<R:8,G:8,B:8>> <= Pixels ].
[{213,45,132},{64,76,32},{76,0,0},{234,32,15}]
-- from LearnYouSomeErlang
Show anon fn’s in many languages using utf8 λ.
Swift property lifecycle callbacks</code></pre>