public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* bug when eliding arguments with default values?
@ 2007-01-18 15:27 Joern Rennecke
  2007-01-22 20:19 ` Frank Ch. Eigler
  0 siblings, 1 reply; 2+ messages in thread
From: Joern Rennecke @ 2007-01-18 15:27 UTC (permalink / raw)
  To: cgen

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)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: bug when eliding arguments with default values?
  2007-01-18 15:27 bug when eliding arguments with default values? Joern Rennecke
@ 2007-01-22 20:19 ` Frank Ch. Eigler
  0 siblings, 0 replies; 2+ messages in thread
From: Frank Ch. Eigler @ 2007-01-22 20:19 UTC (permalink / raw)
  To: Joern Rennecke; +Cc: cgen

Joern Rennecke <joernr@arc.com> writes:

> 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))

It looks like a bug, but honestly, I don't know if anyone is likely to
fix it quickly.  It's probably closest to dje's heart.

- FChE

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-01-22 20:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-18 15:27 bug when eliding arguments with default values? Joern Rennecke
2007-01-22 20:19 ` Frank Ch. Eigler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).