Test output for procedural-macros [ok]

Testing time: 1s

'/usr/home/chicken/salmonella/build/salmonella-run-publish/chicken/bin/csi' -script run.scm < /dev/null 2>&1

Testing procedural-macros ...
----------------------------
(= (Square (Counter)) 1)
... passed in (basic-macros?)
(= (Square (Counter)) 4)
... passed in (basic-macros?)
(= (Square (Counter)) 9)
... passed in (basic-macros?)
(equal? (let ((x 'x) (y 'y)) (Swap! x y) (list x y)) '(y x))
... passed in (basic-macros?)
(eq? (Nif 5 'pos 'zer 'neg) 'pos)
... passed in (basic-macros?)
(eq? (Vif (positive? 5) (then 'pos)) 'pos)
... passed in (basic-macros?)
(equal?
  (map (Alambda (n) (if (zero? n) 1 (* n (self (- n 1))))) '(1 2 3 4 5))
  '(1 2 6 24 120))
... passed in (basic-macros?)
(equal? (let ((x 'x) (y 'y)) (swap! x y) (list x y)) '(y x))
... passed in (procedural-macros?)
(eq? (nif 2 'positive 'zero 'negative) 'positive)
... passed in (procedural-macros?)
(= ((freeze 5)) 5)
... passed in (procedural-macros?)
(equal? (let ((x 'x) (y 'y)) (swap! x y) (list x y)) '(y x))
... passed in (procedural-macros?)
"LITERALS"
... passed in (procedural-macros?)
(= (foo "foo" 1) 1)
... passed in (procedural-macros?)
(equal? (foo "bar" 2) '("bar" 2))
... passed in (procedural-macros?)
(equal? (foo #f 'blabla) '(false))
... passed in (procedural-macros?)
(equal? (foo 1 2) '(1 2))
... passed in (procedural-macros?)
(= (foo 2 3) 2)
... passed in (procedural-macros?)
(= (bar #() 5) 5)
... passed in (procedural-macros?)
(qux #f)
... passed in (procedural-macros?)
"IN?"
... passed in (procedural-macros?)
(in? 2 = 1 2 3)
... passed in (procedural-macros?)
(not (in? 5 = 1 2 3))
... passed in (procedural-macros?)
"VERBOSE IFS"
... passed in (procedural-macros?)
(eq? (oux) 'true)
... passed in (procedural-macros?)
(eq? (pux) 'false)
... passed in (procedural-macros?)
"LOW-LEVEL COND"
... passed in (procedural-macros?)
(my-cond ((> 3 2)))
... passed in (procedural-macros?)
(eq? (my-cond ((> 3 2) 'greater) ((< 3 2) 'less)) 'greater)
... passed in (procedural-macros?)
(eq? (my-cond ((> 3 3) 'greater) ((< 3 3) 'less) (else 'equal)) 'equal)
... passed in (procedural-macros?)
(= (my-cond ((assv 'b `((a 1) (b 2) (C 3))) => cadr) (else #f)) 2)
... passed in (procedural-macros?)
(not (my-cond ((assv 'x `((a 1) (b 2) (C 3))) => cadr) (else #f)))
... passed in (procedural-macros?)
"LETREC"
... passed in (procedural-macros?)
(equal?
  (my-letrec
    ((o? (lambda (m) (if (zero? m) #f (e? (- m 1)))))
     (e? (lambda (n) (if (zero? n) #t (o? (- n 1))))))
    (list (o? 95) (e? 95)))
  '(#t #f))
... passed in (procedural-macros?)
"GENERIC ADD"
... passed in (procedural-macros?)
(= (add 1 2) 3)
... passed in (procedural-macros?)
(string=? (add "x" "y") "xy")
... passed in (procedural-macros?)
"ANAPHORIC MACROS"
... passed in (procedural-macros?)
(equal?
  (map (alambda (n) (if (zero? n) 1 (* n (self (- n 1))))) '(1 2 3 4 5))
  '(1 2 6 24 120))
... passed in (procedural-macros?)
(= (mist 5) 120)
... passed in (procedural-macros?)
"ONCE-ONLY"
... passed in (procedural-macros?)
(= (square (counter)) 1)
... passed in (procedural-macros?)
(= (square (counter)) 4)
... passed in (procedural-macros?)
(= (square (counter)) 9)
... passed in (procedural-macros?)
(let ((lst '()))
  (for (x 0 (counter)) (set! lst (cons x lst)))
  (equal? lst '(3 2 1 0)))
... passed in (procedural-macros?)
"LOCAL VARIABLES AVAILABLE IN EACH RULE"
... passed in (procedural-macros?)
(= (add2 5) 7)
... passed in (procedural-macros?)
(= (add2 5 7) 14)
... passed in (procedural-macros?)
"LET AND LETREC"
... passed in (procedural-macros?)
(= (macro-letrec
     (((sec lst) `(car (res ,lst))) ((res lst) `(cdr ,lst)))
     (sec '(1 2 3)))
   2)
... passed in (procedural-macros?)
(= (macro-let
     (((fir lst) (where (lst list?)) `(car ,lst))
      ((res lst) (where (lst list?)) `(cdr ,lst)))
     (fir (res '(1 2 3))))
   2)
... passed in (procedural-macros?)
(equal?
  (macro-letrec
    (((swap1 x y) `(swap2 ,x ,y))
     ((swap2 x y)
      (where (x symbol?) (y symbol?))
      `(let ((tmp ,y)) (set! ,y ,x) (set! ,x tmp))))
    (let ((x 'x) (y 'y)) (swap1 x y) (swap2 x y) (list x y)))
  '(x y))
... passed in (procedural-macros?)
(equal?
  (macro-let
    (((swap1 x y) `(let ((tmp ,y)) (set! ,y ,x) (set! ,x tmp)))
     ((swap2 x y) `(let ((tmp ,y)) (set! ,y ,x) (set! ,x tmp))))
    (let ((x 'x) (y 'y)) (swap1 x y) (swap2 x y) (list x y)))
  '(x y))
... passed in (procedural-macros?)

Results of procedural-macros
----------------------------
All tests passed