chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] plain lambdas as syntax transformers


From: Jörg F . Wittenberger
Subject: Re: [Chicken-hackers] plain lambdas as syntax transformers
Date: 13 May 2013 13:59:35 +0200

On May 13 2013, John Cowan wrote:

Felix scripsit:

So wwhat would be the right default, if I may ask?

When there is no clear preferred alternative, the right default is no
default: prefer explicit over implicit in this case.

May I 2nd that.

Felix, I don't want to upset you with the arguments.
But your'e probably too much of an expert already to see the point.

The confusion stems from the differences of all those systems,
which do take a lambda and then treat it different.

Plus: some people - like Peter and me - believe that explicit
renaming is a bit low-level and should be used only when
really needed.  Otherwise alt least the newbie should better
choose another transformer.  Clearly enforcing and thereby
documenting which transformer is used is IMHO better than
defaulting.

Also consider: once a programmer got a good reputation, his
code is seen not only by the compiler but by newbies.  The latter
take it as a teaching (at least iff they are smart enough to admit
that there's more to learn).  And it's a non-zero mental effort to
keep track, which Scheme implementation has which default.

Why not have

(define-syntax er-lambda
(syntax-rules ()
  ((_ (e r c) body ...)
   (er-macro-transformer (lambda (e r c) body ...)))))

And then

(define-syntax my-er-based-syntax
 (er-lambda (ex re co)
  ....))

--> 1. no additional indent 2. just three more chars 3.
explicit choice documented 4. when porting to other Schemes, it comes up.


Best

/Jörg




....






reply via email to

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