tisp

tiny lisp
git clone git://edryd.org/tisp
Log | Files | Refs | LICENSE

commit 70155e880d583a4494b6fb9c31f794e3684b321e
parent d639a03bceac93f1cfe8c698381893f2ef117790
Author: Ed van Bruggen <edvb@uw.edu>
Date:   Tue, 25 Jun 2019 14:06:36 -0700

Short circuit or macro

Diffstat:
tibs/lib.tsp | 10++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tibs/lib.tsp b/tibs/lib.tsp @@ -66,10 +66,12 @@ (define nand (macro (a b) (list 'not (list 'and a b)))) -(define (or a b) - (if a t (if b t ()))) -(define (nor a b) - (not (or a b))) +(define or + (macro (a b) + (list 'if a t (list 'if b t ())))) +(define nor + (macro (a b) + (list 'not (list 'or a b)))) ;;; Lists (define first car)