chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] future of chicken?


From: Dale Jordan
Subject: Re: [Chicken-users] future of chicken?
Date: Thu, 8 Aug 2002 14:43:04 -0700

William Annis wrote:

>         My main motivation is ARC (http://www.paulgraham.com/arc.html)
> which includes some radical changes: replacing the wordy 'lambda' with
> 'fn' (making anonymous functions smaller and forcing less
> indentation); making 'if' anaphoric.  That is, have tests bind the
> answer to 'it' in the bodies of the "then" and "else" clauses.

There is no need to replace "lambda"; if you want to have your "fn":

(define-syntax fn
   (syntax-rules ()
      ((_ args body ...)
       (lambda args body ...))))

As for anaphoric "if", it has an appeal; in lieu of that I use
a variant inspired by the "=>" syntax in "cond":

(define-syntax if=>
   (syntax-rules ()
      ((_ test then . else)
       (let ((it test))
         (if it (then it) . else)))))

This applies procedure "then" to the result of the test.  Of course
you have to have a procedure, but this lets you have more "fn".
(There doesn't seem to be any point to binding "it" in the "else"
clause -- it must be #f)

Dale Jordan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]