[r6rs-discuss] typo on page 30

From: Keith Wright <r6rsguy>
Date: Sat, 25 Aug 2007 01:41:16 -0400

On page 30, section 10, we have the example:

  (let ()
    (define-syntax foo
      (lambda (e)
        (let ([+ -]) (+ 1 2))))
    (define + 2)
    (foo))

The second argument of |define-syntax| should
evaluate to a transformer (pg 31, 11.2.2).
A tranformer is...a procedure that must...
return a syntax object (lib pg 51, 12.3).

The procedure in the example returns a number.

It should be:

  (let ()
    (define-syntax foo
      (lambda (e)
        #'(let ([+ -]) (+ 1 2))))
    (define + 2)
    (foo))

A similar change should be made to the corresponding
example above, e.g.

  (let ()
    (define-syntax foo
      (lambda (e)
        #'(+ 1 2)))
    (define + 2)
    (foo))

so that it violates only the restriction that is
to be illustrated, and not others.

  -- Keith
Received on Sat Aug 25 2007 - 01:41:16 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:01 UTC