This is the mail archive of the
cgen@sourceware.org
mailing list for the CGEN project.
bug when eliding arguments with default values?
- From: Joern Rennecke <joernr at arc dot com>
- To: cgen at sources dot redhat dot com
- Date: Thu, 18 Jan 2007 15:27:24 +0000
- Subject: bug when eliding arguments with default values?
I have some problem where I thougt an optional argument would be useful
for a macro that usually doesn't take an argument.
The actual code is a bit complex, so here is a stripped down example:
guile> (define-pmacro '(foo (arg1 . 1)) '(bar arg1))
guile> (pmacro-expand '(foo))
Backtrace:
In ./pmacros.scm:
99: 0 [error "standard input:13:wrong number of arguments to pmacro (foo arg1):"$
165: 1 [-pmacro-error "wrong number of arguments to pmacro (foo arg1)" ()]
164: 2* (if (not #) (-pmacro-error # args))
163: 3 (let ((processed-args #)) (if (not #) (-pmacro-error # args)) ...)
161: 4 (let ((arg-spec #) (default-values #)) (let (#) (if # #) ...))
222: 5 [-pmacro-invoke #(<pmacro> foo (arg1) ...) ()]
221: 6 (if (procedure? #) (-pmacro-invoke macro #) (cons # #))
220: 7 (if macro (if (procedure? #) (-pmacro-invoke macro #) ...) ...)
219: 8 (let ((macro #)) (if macro (if # # #) scanned-exp))
218: 9 (let ((scanned-exp #)) (let (#) (if macro # scanned-exp)))
212: 10 (case (car exp) ((.pmacro) (if # #) (-pmacro-pmacro # #)) (else (let # #)))
229: 11 [scan-list (foo)]
228: 12* (cond ((symbol? exp) (scan-symbol exp)) ((and # #) (scan-list exp)) ...)
228: 13 (let ((result #)) (if (symbol? result) (scan-symbol result) result))
244: 14* [scan (foo)]
244: 15 (let ((result #)) (if -pmacro-trace? (begin # # #)) result)
In unknown file:
?: 16 (letrec (# # # # ...) (if -pmacro-trace? #) (let # # result))
In ./pmacros.scm:
363: 17 [-pmacro-expand (foo) ()]
In standard input:
13: 18* [pmacro-expand (foo)]
./pmacros.scm:99:3: In procedure error in expression (error (string-append # ":" ...) expr):
./pmacros.scm:99:3: standard input:13:wrong number of arguments to pmacro (foo arg1): ()
ABORT: (misc-error)