diff options
| author | Marcos Magueta <maguetamarcos@gmail.com> | 2025-11-12 00:23:20 -0300 |
|---|---|---|
| committer | Marcos Magueta <maguetamarcos@gmail.com> | 2025-11-12 00:23:20 -0300 |
| commit | 19611409cfd2eb2b733705044d844aa2d19c5069 (patch) | |
| tree | 5af7d5fef3faf6ea1086b96acb7f73c88b92d005 /src | |
| parent | 3063608df6ff1668f683d9d22c57fea29d728d0d (diff) | |
| download | Sakura-19611409cfd2eb2b733705044d844aa2d19c5069.tar.gz Sakura-19611409cfd2eb2b733705044d844aa2d19c5069.zip | |
fix startup crash
Diffstat (limited to '')
| -rw-r--r-- | src/main.app.src | 2 | ||||
| -rw-r--r-- | src/main.erl | 29 |
2 files changed, 25 insertions, 6 deletions
diff --git a/src/main.app.src b/src/main.app.src index 0b7700a..34e2f46 100644 --- a/src/main.app.src +++ b/src/main.app.src @@ -2,7 +2,7 @@ {description, "A relational algebra engine"}, {vsn, "0.1.0"}, {registered, []}, - {mod, {main_app, []}}, + {mod, {main, []}}, {applications, [ kernel, stdlib, diff --git a/src/main.erl b/src/main.erl index 3c34a31..5b8d6e3 100644 --- a/src/main.erl +++ b/src/main.erl @@ -1,7 +1,26 @@ -module(main). --export([fibonacci/1]). +-behaviour(application). + +-export([start/2, stop/1]). + +start(_StartType, _StartArgs) -> + %% Start Mnesia (or other children) here + io:format("Starting app...~n"), + + %% Ensure Mnesia is started + mnesia:start(), + + {ok, self()}. + +stop(_State) -> + io:format("Stopping app...~n"), + ok. + +%% setup() -> +%% mnesia:create_table(attributes, [{type, set}, +%% {attributes, [name, value, type]}, +%% {ram_copies, [node()]}, +%% {index, [name]} +%% ]). + -fibonacci(0) -> 0; -fibonacci(1) -> 1; -fibonacci(N) -> - fibonacci(N-2) + fibonacci(N-1). |
