Re: erlang:is_builtin(erlang,apply,3) = false
Björn Gustavsson <[email protected]> Thu, 8 Oct 2015 13:34:33 +0200
| Newsgroups | gmane.comp.lang.erlang.bugs |
|---|---|
| Message-ID | <CA+yh78QGR=znkM14B4aQxg_Rhs3pPpXMqe=trW4Q0hqTe+fSPQ@mail.gmail.com> |
On Wed, Oct 7, 2015 at 10:09 AM, Kostis Sagonas <[email protected]> wrote: > On 10/07/2015 08:20 AM, Björn Gustavsson wrote: >> >> On Wed, Apr 9, 2014 at 7:06 PM, Stavros Aronis<[email protected]> >> wrote: >>> >>> >Hello! >>> > >>> >Title says everything. Is this intentional? >>> > >>> >1> erlang:is_builtin(erlang,apply,3). >>> >false >>> > >> >> May not be intentional, but erlang:apply/3 is a strange >> creature which is not implemented in the same way >> as all other BIFs. Part of apply/3 is in implemented >> in erlang.erl: >> >> apply(Mod, Name, Args) -> >> erlang:apply(Mod, Name, Args). >> >> (This Erlang code will be called if you apply apply/3.) >> >> What do you think? Should erlang:is_builtin(erlang, apply, 3) >> return true? If so, why? > > > Unless I fail to see the point, to me this code is sufficient proof alone > that erlang:apply/3 is a BIF, i.e., a built-in of the language that is > not/cannot not be defined using some other construct of the language. What > does the call in the body of the clause call if not the erlang:apply/3 BIF? That seems reasonable. I will change erlang:builtin(erlang, apply, 3) to return 'true'. I will do the change in the master branch. /Bjorn > > Kostis > > (*) Surely not the head of the clause, because then this code would have no > semantics as Erlang code and a compiler/code transformation program would be > allowed to change a call to erlang:apply/3 with a call to e.g. the loop() -> > loop(). function. > -- Björn Gustavsson, Erlang/OTP, Ericsson AB _______________________________________________ erlang-bugs mailing list [email protected] http://erlang.org/mailman/listinfo/erlang-bugs