From 629a9a6d051b33f4d299f5e924eb794dd844ba0f Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Mon, 15 Apr 2024 15:04:25 -0700 Subject: [PATCH] Improved examples --- examples/hello.modal | 6 +++--- examples/lambda.modal | 1 - examples/map.modal | 8 -------- examples/{test.modal => tests.modal} | 0 makefile | 5 ++--- 5 files changed, 5 insertions(+), 15 deletions(-) delete mode 100644 examples/lambda.modal delete mode 100644 examples/map.modal rename examples/{test.modal => tests.modal} (100%) diff --git a/examples/hello.modal b/examples/hello.modal index 28d8b67..f2efd69 100644 --- a/examples/hello.modal +++ b/examples/hello.modal @@ -1,7 +1,7 @@ ?(?0 ()) (This example prints to the console and demonstrates how to delay the execution of a rule.) <> (NAME) (Modal) -<> (?: print) (?:) -<> (delay ?x) (?x delay) +<> (?: print String) (?:) +<> (String ?x) (?x String) -delay (Welcome to NAME \nHave fun!\n\n) print \ No newline at end of file +String (Welcome to NAME \nHave fun!\n\n) print diff --git a/examples/lambda.modal b/examples/lambda.modal deleted file mode 100644 index 6c90efa..0000000 --- a/examples/lambda.modal +++ /dev/null @@ -1 +0,0 @@ -?((?x ?y) (?y ?x)) foo bar \ No newline at end of file diff --git a/examples/map.modal b/examples/map.modal deleted file mode 100644 index ba064f7..0000000 --- a/examples/map.modal +++ /dev/null @@ -1,8 +0,0 @@ -<> (foo ?x) (?x) -<> (map ?x (list ?l)) (map/l map/x ?x ?l) -<> (map/x ?x (?h ?t)) (?x ?h (map/x ?x ?t)) -<> (map/x ?x (?h)) (map/r (?x ?h)) -<> (?h (map/r ?t)) (?map/r (?h ?t)) -<> (map/l map/r ?l) (list ?l) - -map foo (list (1 (2 (3 (4 (5)))))) \ No newline at end of file diff --git a/examples/test.modal b/examples/tests.modal similarity index 100% rename from examples/test.modal rename to examples/tests.modal diff --git a/makefile b/makefile index 748271f..d3a098f 100644 --- a/makefile +++ b/makefile @@ -8,11 +8,10 @@ all: dest dest: @ mkdir -p bin run: all bin/modal - @ bin/modal examples/hello.modal + @ bin/modal examples/hello.modal 2> /dev/null test: bin/modal-debug bin/modal @ bin/modal -v - @ bin/modal-debug examples/test.modal "(arg1) (arg2 (arg3))" - @ bin/modal examples/test.modal 2> /dev/null + @ bin/modal-debug examples/tests.modal 2> /dev/null install: bin/modal cp bin/modal ~/bin/ uninstall: