home *** CD-ROM | disk | FTP | other *** search
- Would anyone object if we added a macro called 'if' to the default franz
- system? 'if' is a common name and I want to make sure that it doesn't
- break any existing code before I add it.
-
- Some background:
- At mit the 'if' macro is used all over the place.
- Its form is
- (if <predicate> <then-expr> [ <else-expr>])
-
- I've always felt that macros should make the code more readable and
- that the 'if' macro makes code more obscure because it isn't easy
- to tell in complicated 'if' expressions where the <then-expr>
- and <else-expr>'s begin. Also, there is no provision for
- an 'elseif' expression.
-
- I wrote a macro called 'If' which uses keywords to separate clauses.
- (If <pred>
- then <then-expr>
- [elseif <pred> then <then-expr>]*
- [else <else-expr>])
-
- These two macros are not incompatible. one macro could do the job
- of both. There is an ambigous case:
- (if p then x) could be (cond (p then) (t x))
- or (cond (p x))
- but it isn't likely that 'if' macro users would write something like
- that.
-
- Thus I propose that we add a macro, if, which act's like 'If' if
- its second arg is 'then' or like 'if' it the second arg is not 'then'
- and there are two or three arguments. Other cases would cause
- an error.
-
-
-
-
-
-