Skip to content
Browse files

redefined short-circuited boolean operators as macros instead of usin…

…g delayed evaluation
  • Loading branch information...
1 parent ffde2a5 commit cffb650f853f84733ce7d4690c788e4c534be04e @apresta committed Mar 8, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/logic.lm
View
8 lib/logic.lm
@@ -1,11 +1,11 @@
(define (not b)
(if b false true))
-(define (and a $b)
- (if a (force b) false))
+(defmacro (and a b)
+ (if (eval a) (eval b) false))
-(define (or a $b)
- (if a true (force b)))
+(defmacro (or a b)
+ (if (eval a) true (eval b)))
(define (xor a b)
(if a (not b) b))

0 comments on commit cffb650

Please sign in to comment.
Something went wrong with that request. Please try again.