Re: [Scheme-reports] ANN: first draft of R7RS small language available Andre van Tonder (04 May 2011 16:57 UTC)

Re: [Scheme-reports] ANN: first draft of R7RS small language available Andre van Tonder 04 May 2011 16:57 UTC

On Thu, 5 May 2011, Andrzej wrote:

> Except that 'else' or '=>' are not identifiers so the whole concept of
> bindings simply does not apply to them.
>
> It would be great if R7RS could clarify what to do in such situation.

R7RS does clarify this.  At the end of the section on macros, the following
example is explained.  I quote from the spec:

   As an example, if let and cond are defined as in section ... then they are
   hygienic (as required) and the following is not an error.

   (let ((=> #f))
     (cond (#t => 'ok)))                   ===> ok

   The macro transformer for cond recognizes => as a local variable, and hence an
   expression, and not as the top-level identifier =>, which the macro
   transformer treats as a syntactic keyword. Thus the example expands into

   (let ((=> #f))
     (if #t (begin => 'ok)))

   instead of

   (let ((=> #f))
     (let ((temp #t))
       (if temp ('ok temp))))

   which would result in an invalid procedure call.

_______________________________________________
Scheme-reports mailing list
Scheme-reports@scheme-reports.org
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports