iolist_size/1 in guard tests
Mon Jan 24 21:51:29 CET 2022
On 1/4/22 11:05 AM, Aleksander Nycz wrote:
> is_map_key/2 -> O(log(N))
> so guard BIFs definition is:
> complexity < O(N) and side effect free?
The Erlang Language Specification describes guard expressions (at
"The guard tests and their constituent guard expressions (syntactic
category GuardExpr) have been chosen so that they are independent of the
state (i.e., their result depends exclusively on their arguments), have
no side effect and (with a few exceptions) take O(1) time (with respect
to the size of their arguments)."
The main current problem is that erlang:node/0 contradicts this because
it is a guard function that isn't referentially transparent. There
currently are no plans to fix this long-term problem based on the
discussion at https://github.com/erlang/otp/issues/5568
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions