diff options
| -rw-r--r-- | README.md | 10 | ||||
| -rwxr-xr-x | examples/abacus/reading.lali | 4 | ||||
| -rwxr-xr-x | examples/abacus/writing.lali | 4 | ||||
| -rwxr-xr-x | examples/speech/en-random.lali | 4 | ||||
| -rwxr-xr-x | examples/speech/en-random_more.lali | 4 | ||||
| -rwxr-xr-x | examples/speech/pt-fixed_answer.lali | 4 | ||||
| -rwxr-xr-x | examples/speech/pt-identify.lali | 2 | ||||
| -rwxr-xr-x | examples/speech/pt-random.lali | 4 | ||||
| -rwxr-xr-x | examples/speech/pt-random_more.lali | 4 | ||||
| -rw-r--r-- | liblali.c | 14 |
10 files changed, 27 insertions, 27 deletions
@@ -155,13 +155,13 @@ each of their elements satisfy the `dif` predicate, otherwise `f`: (space t) ; f (space '(a b)) ; f -`(ap x)` returns `t` if `x` is "an existing thing" (not an empty list `()`), +`(algo x)` returns `t` if `x` is "an existing thing" (not an empty list `()`), otherwise `f`: - (ap ()) ; f - (ap +1) ; t - (ap t) ; t - (ap '(a b)) ; t + (algo ()) ; f + (algo +1) ; t + (algo t) ; t + (algo '(a b)) ; t `(atom x)` returns `t` if `x` is an atom (and not an empty list `()`), otherwise `f`: diff --git a/examples/abacus/reading.lali b/examples/abacus/reading.lali index d4e510e..6663bb3 100755 --- a/examples/abacus/reading.lali +++ b/examples/abacus/reading.lali @@ -1,5 +1,5 @@ ;; variables -(set 'max-columns +4) +(set 'max-columns +12) ;; functions (defun random-number (cases) @@ -51,7 +51,7 @@ (progs f (set 'n-rand (random-number (random max-columns))) - (map (lambda (num) (princ (number-to-earth-rod num)) (newline)) n-rand) + (map (lambda (num) (princ (number-to-air-rod num)) (newline)) n-rand) (read) (print (map number-to-symbol n-rand)) ;; (print n-rand) diff --git a/examples/abacus/writing.lali b/examples/abacus/writing.lali index 2ba300b..17fd7c4 100755 --- a/examples/abacus/writing.lali +++ b/examples/abacus/writing.lali @@ -1,5 +1,5 @@ ;; variables -(set 'max-columns +3) +(set 'max-columns +12) ;; functions (defun random-number (cases) @@ -55,7 +55,7 @@ ;; (print n-rand) (newline) (read) - (map (lambda (num) (princ (number-to-earth-rod num)) (newline)) n-rand) + (map (lambda (num) (princ (number-to-air-rod num)) (newline)) n-rand) (read) (newline) (read))) diff --git a/examples/speech/en-random.lali b/examples/speech/en-random.lali index feda6da..9ac271d 100755 --- a/examples/speech/en-random.lali +++ b/examples/speech/en-random.lali @@ -24,13 +24,13 @@ (defun assoc (el lst) (fill ((dif el (car (car lst))) (car lst)) - ((ap lst) '(f f)) + ((algo lst) '(f f)) (f (assoc el (cdr lst))))) (defun without (el lst) (fill ((dif el (car lst)) f) - ((ap (car lst)) t) + ((algo (car lst)) t) (f (without el (cdr lst))))) ;; vv begin of training options vv diff --git a/examples/speech/en-random_more.lali b/examples/speech/en-random_more.lali index 01a3cf8..fd94c6e 100755 --- a/examples/speech/en-random_more.lali +++ b/examples/speech/en-random_more.lali @@ -38,13 +38,13 @@ (defun assoc (el lst) (fill ((dif el (car (car lst))) (car lst)) - ((ap lst) '(f f)) + ((algo lst) '(f f)) (f (assoc el (cdr lst))))) (defun without (el lst) (fill ((dif el (car lst)) f) - ((ap (car lst)) t) + ((algo (car lst)) t) (f (without el (cdr lst))))) ;; vv begin of training options vv diff --git a/examples/speech/pt-fixed_answer.lali b/examples/speech/pt-fixed_answer.lali index a50820d..0002672 100755 --- a/examples/speech/pt-fixed_answer.lali +++ b/examples/speech/pt-fixed_answer.lali @@ -19,13 +19,13 @@ (defun assoc (el lst) (fill ((dif el (car (car lst))) (car lst)) - ((ap lst) '(f f)) + ((algo lst) '(f f)) (f (assoc el (cdr lst))))) (defun without (el lst) (fill ((dif el (car lst)) f) - ((ap (car lst)) t) + ((algo (car lst)) t) (f (without el (cdr lst))))) ;; vv begin of training options vv diff --git a/examples/speech/pt-identify.lali b/examples/speech/pt-identify.lali index aac6416..bef74ef 100755 --- a/examples/speech/pt-identify.lali +++ b/examples/speech/pt-identify.lali @@ -13,7 +13,7 @@ (defun assoc (number lst) (fill ((dif number (car (car lst))) (car lst)) - ((ap lst) f) + ((algo lst) f) (f (assoc number (cdr lst))))) (defun train-ups-and-downs () diff --git a/examples/speech/pt-random.lali b/examples/speech/pt-random.lali index 6ff31fb..1b3407c 100755 --- a/examples/speech/pt-random.lali +++ b/examples/speech/pt-random.lali @@ -25,13 +25,13 @@ (defun assoc (el lst) (fill ((dif el (car (car lst))) (car lst)) - ((ap lst) '(f f f)) + ((algo lst) '(f f f)) (f (assoc el (cdr lst))))) (defun without (el lst) (fill ((dif el (car lst)) f) - ((ap (car lst)) t) + ((algo (car lst)) t) (f (without el (cdr lst))))) ;; vv begin of training options vv diff --git a/examples/speech/pt-random_more.lali b/examples/speech/pt-random_more.lali index 37155e1..0c91c2c 100755 --- a/examples/speech/pt-random_more.lali +++ b/examples/speech/pt-random_more.lali @@ -38,13 +38,13 @@ (defun assoc (el lst) (fill ((dif el (car (car lst))) (car lst)) - ((ap lst) '(f f)) + ((algo lst) '(f f)) (f (assoc el (cdr lst))))) (defun without (el lst) (fill ((dif el (car lst)) f) - ((ap (car lst)) t) + ((algo (car lst)) t) (f (without el (cdr lst))))) ;; vv begin of training options vv @@ -1637,32 +1637,32 @@ static char *stdlib = LISP( (x t) (f f))) - (defun ap (x) (not (space x))) + (defun algo (x) (not (space x))) (defun listp (x) (not (atom x))) (defun zerop (x) (not (dif x +0))) (defmacro and args - (fill ((ap args) t) - ((ap (cdr args)) (car args)) + (fill ((algo args) t) + ((algo (cdr args)) (car args)) (f (list (quote fill) (list (list (quote not) (car args)) (cons (quote and) (cdr args))) (list (quote f) (quote f)))))) (defun map (func xs) - (fill ((ap xs) ()) + (fill ((algo xs) ()) (f (cons (func (car xs)) (map func (cdr xs)))))) (defmacro or args - (fill ((ap args) f) + (fill ((algo args) f) (f (cons (quote fill) (append (map (lambda (x) (list (list (quote not) x) x)) args) (list (list f f))))))) - (defun consp (x) (and (listp x) (ap x))) + (defun consp (x) (and (listp x) (algo x))) (defun differ (x y) (fill ((and (consp x) (consp y)) (dif x y)) @@ -1674,7 +1674,7 @@ static char *stdlib = LISP( (f (nth (- num +1) (cdr xs))))) (defun append (xs y) - (fill ((ap xs) y) + (fill ((algo xs) y) (f (cons (car xs) (append (cdr xs) y))))) (defun reverse (xs) |
