home *** CD-ROM | disk | FTP | other *** search
- I've added the 'if' macro to franz. If you have any objections, it is still
- not too late to voice them.
- I've also defined 'If' to be the same as 'if'.
-
- As I mentioned in my earlier request for comments, the 'if' macro is a
- cross between the mit version and a locally written version using keywords.
- The following documentation describes the various forms.
- As you know, you can test out the 'if' macro by using apply. for example:
-
- => (apply 'if '(if a then b c elseif d thenret else e))
- (cond (a b c) (d) (t e))
-
-
- ;
- ; This macro is compatible with both the crufty mit-version and
- ; the keyword version at ucb.
- ;
- ; simple summary:
- ; non-keyword use:
- ; (if a b) ==> (cond (a b))
- ; (if a b c d e ...) ==> (cond (a b) (t c d e ...))
- ; with keywords:
- ; (if a then b) ==> (cond (a b))
- ; (if a thenret) ==> (cond (a))
- ; (if a then b c d e) ==> (cond (a b c d e))
- ; (if a then b c else d) ==> (cond (a b c) (t d))
- ; (if a then b c elseif d thenret else g)
- ; ==> (cond (a b c) (d) (t g))
- ;
- ;
- ;
- ;
- ; In the syntax description below,
- ; optional parts are surrounded by [ and ],
- ; + means one or more instances.
- ; | means 'or'
- ; <expr> is an lisp expression which isn't a keyword
- ; The keywords are: then, thenret, else, elseif.
- ; <pred> is also a lisp expression which isn't a keyword.
- ;
- ; <if-stmt> ::= <simple-if-stmt>
- ; | <keyword-if-stmt>
- ;
- ; <simple-if-stmt> ::= (if <pred> <expr>)
- ; | (if <pred> <expr> <expr>)
- ;
- ; <keyword-if-stmt> ::= (if <pred> <then-clause> [ <else-clause> ] )
- ;
- ; <then-clause> ::= then <expr>+
- ; | thenret
- ;
- ; <else-clause> ::= else <expr>+
- ; | elseif <pred> <then-clause> [ <else-clause> ]
-
-
-
-
-
-
-