Improved examples

This commit is contained in:
Devine Lu Linvega 2024-04-15 15:04:25 -07:00
parent d8cefb2923
commit 629a9a6d05
5 changed files with 5 additions and 15 deletions

View File

@ -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
String (Welcome to NAME \nHave fun!\n\n) print

View File

@ -1 +0,0 @@
?((?x ?y) (?y ?x)) foo bar

View File

@ -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))))))

View File

@ -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: