<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><span class="code">is_map_key/2 -> O(log(N))</span></p>
<p><span class="code">so guard BIFs definition is:</span></p>
<p><span class="code">complexity < O(N) and </span><span
class="code">side effect free?</span></p>
<p><span class="code"><br>
</span></p>
<div class="moz-cite-prefix">W dniu 04.01.2022 o 19:41, Mark Jones
pisze:<br>
</div>
<blockquote type="cite"
cite="mid:CAB9a5ciJ=zmkJRjXsrc_XUsH736hnWdd9wENVaKd3nRGWHQNyQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div id="gmail-:w4" class="gmail-Am gmail-aO9 gmail-Al editable
gmail-LW-avf gmail-tS-tW gmail-tS-tY" aria-label="Message
Body" role="textbox" aria-multiline="true" tabindex="1"
style="direction:ltr;min-height:85px">So guard BIFs are
supposed to be O(1) not just side effect free?</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Tue, Jan 4, 2022 at 12:36
PM Loïc Hoguin <<a href="mailto:essen@ninenines.eu"
moz-do-not-send="true" class="moz-txt-link-freetext">essen@ninenines.eu</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Yes
but that's considered a historical error.<br>
<br>
On 04/01/2022 18:38, Mark Jones wrote:<br>
> But length/1 is allowed in guard tests and it is O(N).<br>
> <br>
> Cheers,<br>
> Mark<br>
> <br>
> On Tue, Jan 4, 2022 at 2:53 AM Aleksander Nycz <br>
> <<a href="mailto:Aleksander.Nycz@comarch.pl"
target="_blank" moz-do-not-send="true"
class="moz-txt-link-freetext">Aleksander.Nycz@comarch.pl</a>
<mailto:<a href="mailto:Aleksander.Nycz@comarch.pl"
target="_blank" moz-do-not-send="true"
class="moz-txt-link-freetext">Aleksander.Nycz@comarch.pl</a>>>
wrote:<br>
> <br>
> Probably<br>
> <br>
> iolist_size/1 -> O(N)<br>
> <br>
> byte_size/1 -> O(1)<br>
> <br>
> <br>
> Regards<br>
> Aleksander<br>
> <br>
> <br>
> W dniu 04.01.2022 o 09:49, Mark Jones pisze:<br>
> > Is there a reason iolist_size/1 is not a guard
BIF like byte_size/1<br>
> > and bit_size/1?<br>
> ><br>
> > Cheers,<br>
> > Mark<br>
> <br>
<br>
-- <br>
Loïc Hoguin<br>
<a href="https://ninenines.eu" rel="noreferrer"
target="_blank" moz-do-not-send="true"
class="moz-txt-link-freetext">https://ninenines.eu</a><br>
</blockquote>
</div>
</blockquote>
</body>
</html>