guile-user
[Top][All Lists]
Advanced

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

Re: local syntax-rules


From: Lars J. Aas
Subject: Re: local syntax-rules
Date: Mon, 6 Nov 2000 17:14:08 +0100
User-agent: Mutt/1.2.5i

On Mon, Nov 06, 2000 at 05:50:34PM +0200, Ivan Toshkov wrote:
: Use let-syntax

I tried replacing

  (define-syntax argtype
    (syntax-rules ()
      ((argtype (name type)) type)
      ((argtype name) <top>)))
 
  (define-syntax argtypes
    (syntax-rules ()
      ((argtypes arg)
        (cons (argtype arg) '()))
      ((argtypes arg arg1 ...)
        (cons (argtype arg) (argtypes arg1 ...)))))

with

  (define-syntax argtypes
    (let-syntax ((argtype (syntax-rules ()
                            ((argtype (name type)) type)
                            ((argtype name) <top>))))
      (syntax-rules ()
        ((argtypes arg) (cons (argtype arg) '()))
        ((argtypes arg arg1 ...) (cons (argtype arg) (argtypes arg1 ...))))))

but I got this error:

/usr/local/share/guile/1.4/ice-9/syncase.scm:88:16: In procedure scm-error in 
expression (scm-error (quote misc-error) who ...):
/usr/local/share/guile/1.4/ice-9/syncase.scm:88:16: reference to identifier 
outside its scope argtype

Should I use let-syntax in another way (e.g. *inside* the argtypes 
syntax-rules)?

  Lars J



reply via email to

[Prev in Thread] Current Thread [Next in Thread]