The release has a lot of new different features and changes. The first thing is that the versioning scheme has been changed. Previously it was R15B, R16B, etc.
New data type — Maps
This one is the most noticeable change that the community had been waiting a long time for. See an example below:
1> Map = #{ key1 => "Value1", key2 => "Value2"}.
#{key1 => "Value1",key2 => "Value2"}
2> maps:get(key1, Map).
"Value1"
#{key2 := MatchValue} = Map.
#{key1 => "Value1",key2 => "Value2"}
4> MatchValue.
"Value2"
Map2 = Map#{key3 => "Value3"}.
#{key1 => "Value1",key2 => "Value2",key3 => "Value3"}
Map3 = Map2#{key1 := change_value1}.
#{key1 => change_value1,key2 => "Value2",key3 => "Value3"}
This data type is still experimental and has a few limits:
- Values can only be extracted via helper functions. You can not access a key by its name. This will not work:
Value = Map#{key1}
- You can not set a key which is not known during the compilation time.
Here is the whole list of features, which will be implemented later.
Erlang/OTP has been ported to the real time operating system OSE
OSE is a high-performance, POSIX compatible, multicore real-time operating system maximizing your hardware utilization
The highlights show that not all the parts of the platform have been ported though.
Anonymous functions can have names
...and can be used in recursion:
1> TestFun = fun Factorial(0) -> 1; Factorial(Num) when Num > 0 -> Num * Factorial(Num - 1) end.
#Fun
2> TestFun(4).
24
Improved Unicode support
For example, the default encoding for all the source files is now UTF-8.
And much more
- New option {active, N} for TCP, UDP and SCTP sockets
- Improved the mapping from ASN.1 OCTET STRING and bit strings to Erlang data-types
- New optional scheduler utilization balancing mechanism (optional)
- Experimental “dirty scheduler” functionality
LYSE has added new chapter about maps.
Joe Armstrong's post about the release.
Changelist
Official release announcement
0 comments
Upload image