SEE Implementation Details

The shell script (see) that starts everything is as follows:

 
#!/bin/sh
 
erl ​-boot​ /home/joe/erl/example_programs​-2​.0/examples​-2​.0/see\
 
-environment​ `printenv` ​-load​ $1

The SEE Main Program

When the system is started, see:main() is evaluated, and when this terminates, the system will halt. see:main() is as follows:

see/see.erl
 
main() ->
 
make_server(io,
 
fun​ start_io/0, ​fun​ handle_io/2),
 
make_server(code,
 
const([lists,error_hander,see|preloaded()]),
 
fun​ handle_code/2),
 
make_server(error_logger,
 
const(0), ​fun​ handle_error_logger/2),
 
make_server(halt_demon,
 
const([]), ​fun​ handle_halt_demon/2),
 
make_server(env,
 
fun​ start_env/0, ​fun​ handle_env/2),
 
Mod = get_module_name(), ...

Get Programming Erlang, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.