[r6rs-discuss] typo on page 30

Keith Wright r6rsguy at free-comp-shop.com
Sat Aug 25 01:41:16 EDT 2007


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



More information about the r6rs-discuss mailing list