A.ord_size
You're seeing just the macro
ord_size
, go back to A module for more information.
Returns the size of an ord_map
.
It is implemented as a macro so that it can be used in guards.
When used outside of a guard, it will just be replaced by a call to A.OrdMap.size/1
.
When used in guards, it will fail if called on something else than an A.OrdMap
.
It is recommended to verify the type first.
Runs in constant time.
Examples
iex> import A
iex> ord_map = A.OrdMap.new(a: 1, b: 2, c: 3)
iex> match?(v when ord_size(v) > 5, ord_map)
false
iex> match?(v when ord_size(v) < 5, ord_map)
true
iex> ord_size(ord_map)
3