Erlang Examples ⬆
Directory examples\ contains Erlang code examples coming from various websites - mostly from the Erlang project.It also includes build scripts (bash scripts, batch files, Make scripts) for experimenting with Erlang on a Windows machine. |
This example has the following directory structure :
> tree /a /f . | findstr /v /b [A-Z] | 00download.txt | build.bat | build.sh | Makefile \---src \---main \---erlang factorial.erl
Command build.bat
generates and executes the Erlang program factorial.beam
:
> build -verbose run Compile 1 Erlang source file into directory "target" Execute Erlang program "target\factorial.beam" fac1(10) = 120 fac2(10) = 120 fac3(10) = 120
hello
Example ▴
This example has the following directory structure :
> tree /a /f . | findstr /v /b [A-Z] | build.bat | build.sh | Makefile \---src \---main \---erlang hello.erl
Command build.sh
generates and executes the Erlang program hello.beam
:
> sh ./build.sh -verbose clean run Compile 1 Erlang source file to directory "target" Execute Erlang program "target\hello.beam" Hello, World!