[erlang-questions] What is the function be defined as BIF?

LUKE <>
Tue Nov 27 07:50:45 CET 2007


-module(genserver).
-export([start/2,rpc/2]).

start(Name,Mod)->register(spawn(fun()->loop(Name,Mod,Mod:init()) end)).
....

Eshell V5.5.5  (abort with ^G)
...
9>c(genserver).
./genserver.erl:4: function register/1 undefined

--
modify the register to  erlang:register
start(Name,Mod)->erlang:register(spawn(fun()->loop(Name,Mod,Mod:init()) end)).
--

10> c(genserver).
{ok,genserver}

The register function is BIF ? 
And the spawn function is BIF? 
All of erlang:* is BIF?
When we need specify a prefix erlang:* ?
Why the most of example does not using erlang:register?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20071127/ad826329/attachment.html>


More information about the erlang-questions mailing list