Re: [Scheme-reports] ANN: first draft of R7RS small language available
Andre van Tonder 03 May 2011 14:35 UTC
On Tue, 3 May 2011, Andrzej wrote:
> In my implementation I've implemented 'cond' so that it recognizes
> 'else' by looking at the name of the symbol. If I have to fix it I'd
> like to know what the correct version is, why it is correct and why my
> implementation is wrong.
Here is a good example illustrating the problems of your proposed
implementation.
Consider the following inline macro that converts a Scheme value to its boolean
representative:
(define-syntax convert-to-boolean
(syntax-rules ()
((_ exp)
(cond (exp #t)
(else #f)))))
Now imagine a user who knows that there are no reserved words in Scheme
and who knows nothing of the implementation of convert-to-boolean
does the following:
(let ((else #f))
(convert-to-boolean else))
What answer should he get?
What answer would he get in your implementation?
Andre
_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports