by himom · 8y ago · 0 comments
++x; // x = x + 1
Nifty syntax &: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 callbacksNo comments yet.