[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Scheme-reports] ANN: first draft of R7RS small language available
- To: Andrzej <ndrwrdck@x>
- Subject: Re: [Scheme-reports] ANN: first draft of R7RS small language available
- From: Andre van Tonder <andre@x>
- Date: Tue, 3 May 2011 23:07:16 -0400 (EDT)
- Cc: scheme-reports <scheme-reports@x>
- In-reply-to: <BANLkTi=uH91qemtfe5tzCcAVUkpQcXCwJQ@mail.gmail.com>
- References: <BANLkTim=5TfhBkDHj9Pv_R+S99JrEeNojw@mail.gmail.com> <Pine.SOC.firstname.lastname@example.org> <BANLkTi=uH91qemtfe5tzCcAVUkpQcXCwJQ@mail.gmail.com>
On Wed, 4 May 2011, Andrzej wrote:
On Tue, May 3, 2011 at 11:35 PM, Andre van Tonder <andre@x> wrote:
(cond (exp #t)
(let ((else #f))
What answer should he get?
What answer would he get in your implementation?
My implementation will return #f here (that is once I have macro
expansion in place) because it expands to:
(let ((else #f))
(else #f))) => #f
I am not sure, but I think this might be a syntax error, given that the spec
The LAST <clause> may be an ``else clause,''
Be that as it may, let me give another example. I am pretty sure that the
the spec requires the following to evaluate to 1.
(cond (x => (lambda (x) x))))))
(let ((else 1))
(nonfalse-identity else)) ====> 1
but I think your implementation will give the wrong result here (or an error).
Here is anotehr example, which evaluates a given expression (in case it has
side effects) and returns 1. It is a silly way of doing this, but there is no
doubt that the spec requires the answer to be 1.
(cond (#t exp 1)))))
(let ((=> 0))
(map-to-identity =>)) ======> 1
Again, I believe your implementation will return the wrong answer (or an error).
Scheme-reports mailing list