Loading Fundamental.lisp +5 −5 Original line number Diff line number Diff line Loading @@ -440,15 +440,15 @@ firstval (eval-list rest))))) (defspecial unless (cond &rest body) "if COND yields nil, eval &rest BODY and return the result of the last" (defspecial unless (cond &rest bodyforms) "if COND yields nil, eval &rest BODYFORMS and return the result of the last" (if (not (eval cond)) (eval-list bodyforms))) (defspecial when (cond &rest body) "if COND yields true, eval &rest BODY and return the result of the last" (defspecial when (cond &rest bodyforms) "if COND yields true, eval &rest BODYFORMS and return the result of the last" (if (eval cond) (eval-list body))) (eval-list bodyforms))) (defspecial cond (&rest clauses) (if (null clauses) Loading tests/notyet/027-when-unless.lispdeleted 100644 → 0 +0 −13 Original line number Diff line number Diff line (defun false () nil) (defun true () t) (testcmp "when 0" '(when (false) (+ 13 14) (* 15 16) 332) nil) (testcmp "when 1" '(when (true) (+ 13 14) (* 15 16) 332) 332) (testcmp "when 2" '(let (a) (when (true) (setq a 115) 19) a) 115) (testcmp "unless 0" '(unless (false) (+ 13 14) (* 15 16) 332) 332) (testcmp "unless 1" '(unless (true) (+ 13 14) (* 15 16) 332) nil) (testcmp "unless 2" '(let (a) (unless (false) (setq a 115) 19) a) 115) Loading
Fundamental.lisp +5 −5 Original line number Diff line number Diff line Loading @@ -440,15 +440,15 @@ firstval (eval-list rest))))) (defspecial unless (cond &rest body) "if COND yields nil, eval &rest BODY and return the result of the last" (defspecial unless (cond &rest bodyforms) "if COND yields nil, eval &rest BODYFORMS and return the result of the last" (if (not (eval cond)) (eval-list bodyforms))) (defspecial when (cond &rest body) "if COND yields true, eval &rest BODY and return the result of the last" (defspecial when (cond &rest bodyforms) "if COND yields true, eval &rest BODYFORMS and return the result of the last" (if (eval cond) (eval-list body))) (eval-list bodyforms))) (defspecial cond (&rest clauses) (if (null clauses) Loading
tests/notyet/027-when-unless.lispdeleted 100644 → 0 +0 −13 Original line number Diff line number Diff line (defun false () nil) (defun true () t) (testcmp "when 0" '(when (false) (+ 13 14) (* 15 16) 332) nil) (testcmp "when 1" '(when (true) (+ 13 14) (* 15 16) 332) 332) (testcmp "when 2" '(let (a) (when (true) (setq a 115) 19) a) 115) (testcmp "unless 0" '(unless (false) (+ 13 14) (* 15 16) 332) 332) (testcmp "unless 1" '(unless (true) (+ 13 14) (* 15 16) 332) nil) (testcmp "unless 2" '(let (a) (unless (false) (setq a 115) 19) a) 115)