Artifact a955a45f26e6594c90eae4d3d0849c24f153f5987beb2cb016d52f077164453d:
- File
psl-1983/3-1/util/cond-macros.sl
— part of check-in
[eb17ceb7f6]
at
2020-04-21 19:40:01
on branch master
— Add Reduce 3.0 to the historical section of the archive, and some more
files relating to version sof PSL from the early 1980s. Thanks are due to
Paul McJones and Nelson Beebe for these, as well as to all the original
authors.git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/historical@5328 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 747) [annotate] [blame] [check-ins using] [more...]
- File
psl-1983/util/cond-macros.sl
— part of check-in
[eb17ceb7f6]
at
2020-04-21 19:40:01
on branch master
— Add Reduce 3.0 to the historical section of the archive, and some more
files relating to version sof PSL from the early 1980s. Thanks are due to
Paul McJones and Nelson Beebe for these, as well as to all the original
authors.git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/historical@5328 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 747) [annotate] [blame] [check-ins using]
% COND-MACROS.SL - convenient macros for conditional expressions % % Author: Don Morrison % Symbolic Computation Group % Computer Science Dept. % University of Utah % Date: Wednesday, 12 May 1982 % Copyright (c) 1981 University of Utah (defmacro if (predicate then . else) (cond ((null else) `(cond (,predicate ,then))) (t `(cond (,predicate ,then) (t . ,else))))) (defmacro xor (u v) % done this way to both "semi-open-code" but not repeat the code for either % arg; also evaluates args in the correct (left to right) order. `((lambda (***XOR-ARG***) (if ,v (not ***XOR-ARG***) ***XOR-ARG***)) ,u)) (defmacro when (p . c) `(cond (,p . ,c))) (defmacro unless (p . c) `(cond ((not ,p) . ,c)))