Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "new" do when called on an erlang module do?

Tags:

erlang

I've seen module_name:new used in Erlang code, but there is no reference to a "new" function in the module_name module. What does "new" do?

like image 345
yazz.com Avatar asked Feb 17 '10 18:02

yazz.com


People also ask

What does spawn do in Erlang?

spawn() creates a new process and returns the pid. The new process starts executing in Module:Name(Arg1,...,ArgN) where the arguments are the elements of the (possible empty) Args argument list. There exist a number of different spawn BIFs: spawn/1,2,3,4.

How do I end a process in Erlang?

A process can terminate itself by calling one of the BIFs exit(Reason), erlang:error(Reason), erlang:error(Reason, Args), erlang:fault(Reason) or erlang:fault(Reason, Args). The process then terminates with reason Reason for exit/1 or {Reason,Stack} for the others.

What are Erlang processes?

Erlang processes are lightweight, operate in (memory) isolation from other processes, and are scheduled by Erlang's Virtual Machine (VM). The creation time of process is very low, the memory footprint of a just spawned process is very small, and a single Erlang VM can have millions of processes running.

What is module in Erlang?

Modules are a bunch of functions regrouped in a single file, under a single name. Additionally, all functions in Erlang must be defined in modules. Most of the basic functionality like arithmetic, logic and Boolean operators are already available because the default modules are loaded when a program is run.


1 Answers

It is for "parametrized module": see here and there for more details.

like image 119
jldupont Avatar answered Sep 16 '22 22:09

jldupont