From: Joern Rennecke <joernr@arc.com>
To: cgen@sources.redhat.com
Subject: bug when eliding arguments with default values?
Date: Thu, 18 Jan 2007 15:27:00 -0000 [thread overview]
Message-ID: <20070118152724.GC1641@elsdt-razorfish.arc.com> (raw)
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)
next reply other threads:[~2007-01-18 15:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-18 15:27 Joern Rennecke [this message]
2007-01-22 20:19 ` Frank Ch. Eigler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070118152724.GC1641@elsdt-razorfish.arc.com \
--to=joernr@arc.com \
--cc=cgen@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).