Skip to content

Latest commit

 

History

History
74 lines (58 loc) · 3.64 KB

README.md

File metadata and controls

74 lines (58 loc) · 3.64 KB

Erlang Examples

Erlang project 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.

factorial Example

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!

mics/February 2025