public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* Opinions wanted: What should (.list pmacro-name 42) do?
@ 2009-08-20 17:30 Doug Evans
  2009-08-20 17:44 ` Doug Evans
  2009-08-20 18:24 ` Jim Blandy
  0 siblings, 2 replies; 4+ messages in thread
From: Doug Evans @ 2009-08-20 17:30 UTC (permalink / raw)
  To: cgen

Hi.

What should the output of

(define-pmacro (foo a) (add a 1))
(.list foo 42)

be?

Currently the result is (<pmacro> 42)
where <pmacro> is the pmacro object for "foo".

It's not ideal because it means that a pmacro object "escapes" 
pmacro-processing and can be seen by, for example, rtl compilation.

However, it's not that unexpected.  The user asked for a list containing 
two objects, the pmacro and 42.
This is akin to saying (list + 42) in Scheme.

We *could* have the pmacro evaluator re-examine the result and if it 
sees (<pmacro> mumble) then re-expand it.  That's what we do for symbols 
today (i.e. if the result of pmacro-expansion is a symbol that names a 
pmacro, we re-evaluate it), but that has problems, e.g.
http://sourceware.org/ml/cgen/2009-q3/msg00052.html
and I'm leaning toward removing that behavior.

It's not clear to me what The Right Thing to do is.
Opinions?

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

end of thread, other threads:[~2009-08-21  4:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-20 17:30 Opinions wanted: What should (.list pmacro-name 42) do? Doug Evans
2009-08-20 17:44 ` Doug Evans
2009-08-20 18:24 ` Jim Blandy
2009-08-21  4:30   ` Doug Evans

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