<div dir="ltr">For this particular function its a delegation to <a href="https://github.com/erlang/otp/blob/master/erts/preloaded/src/prim_net.erl#L160">prim_net:getnameinfo/2</a> or erlang:error(notsup). Of course, apart from some argument match. <div><br></div><div>Interesting. </div><div><br></div><div>And Micael mentioned its destined to be removed in future. 😑<br><div><br></div><div><span style="color:rgb(207,203,196)">नमस्ते।</span><br style="color:rgb(207,203,196)"><span style="color:rgb(207,203,196)">नलिन रंजन</span><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 27, 2021 at 9:13 AM Nalin Ranjan <<a href="mailto:ranjanified@gmail.com">ranjanified@gmail.com</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"><div dir="auto">Thanks a lot Nicolas. <div dir="auto"><br></div><div dir="auto">Will go through, and then may be express my hunch that this is a way in which details are either leaking and/or is not sufficient at the level of a type spec. But who knows I endup correcting myself after a little follow up.<br><br><div dir="auto">नमस्ते।<br>नलिन रंजन</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 26, 2021, 10:05 PM Nicolas Martyanoff <<a href="mailto:khaelin@gmail.com" target="_blank">khaelin@gmail.com</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">On 2021-01-26 21:46, Nalin Ranjan wrote:<br>
> 2. In this particular case of type specification, the only difference is in<br>
> one of the parameters of the function. I was also wondering if we could<br>
> have used a union instead to write the same type spec, it would have been<br>
> simpler?<br>
> For example,<br>
> Instead of writing a type spec like this<br>
> <br>
> -ifdef(SOME_PRAGMA_CONDITION)<br>
>           SomeVar :: xxx_type().<br>
> -else<br>
>          SomeVar :: yyy_type().<br>
> <br>
> We could specify the same type spec as:<br>
>         SomeVar :: xxx_type() | yyy_type().<br>
> <br>
> Any reason we preferred the former over the latter?<br>
<br>
If Erlang is compiled without socket support, some types will not exist at<br>
all. Using the preprocessor[1] makes it possible to provide specifications<br>
with types which actually exist, with or without socket support.<br>
<br>
[1] <a href="https://erlang.org/doc/reference_manual/macros.html" rel="noreferrer noreferrer" target="_blank">https://erlang.org/doc/reference_manual/macros.html</a><br>
<br>
-- <br>
Nicolas Martyanoff<br>
<a href="http://snowsyn.net" rel="noreferrer noreferrer" target="_blank">http://snowsyn.net</a><br>
<a href="mailto:khaelin@gmail.com" rel="noreferrer" target="_blank">khaelin@gmail.com</a><br>
</blockquote></div>
</blockquote></div>