[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

No Subject



The syntax-case based implementation of the R4RS macro system I have
made available handles combinations of internal define and
define-syntax forms, and the definition for factorial above works in
that system.  The output of expand-syntax shows the letrec form:

   > (expand-syntax
        '(lambda (n)
            (define f (lambda (x) (if (= x 0) 1 (* x (g x)))))
            (define-syntax g (syntax-rules () ((g y) (f (- y 1)))))
            (f 10)))
   (lambda (n)
      (letrec ([f (lambda (x) (if (= x '0) '1 (* x (f (- x '1)))))])
         (f '10)))

I see no reason why the report should not require internal
define-syntax expressions; however, others may wish to shy away from
them since they cannot be washed away conceptually at the source
level.

Kent