From: Daniel Colascione <dancol@dancol.org>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] trunk r117002: Correctly treat progn contents as toplevel forms when byte compiling
Date: Tue, 22 Apr 2014 11:13:47 -0700 [thread overview]
Message-ID: <5356B15B.7020802@dancol.org> (raw)
In-Reply-To: <5356A56B.4060501@dancol.org>
[-- Attachment #1: Type: text/plain, Size: 1943 bytes --]
On 04/22/2014 10:22 AM, Daniel Colascione wrote:
> On 04/22/2014 08:06 AM, Stefan Monnier wrote:
>> And if you insist on doing it this way, you can wrap the cl-defstruct
>> within an eval-and-compile.
>>
>> The problem with relying on CL semantics, is that it means that your
>> iface-declare will only work at top-level, e.g. not within a `cl-letf'
>> or a `cl-flet' or ...
>> a
>> So while the current semantics bites you, CL's semantics will also bite
>> you in other cases. IOW They just try to avoid biting you in a couple
>> more cases, but they can't avoid the fundamental problem.
>>
>> The above example doesn't convince me yet that the convenience of hiding
>> the fundamental problem in those few cases is worth the trouble.
>>
>> Maybe to solve this problem right, we'd need to do it in
>> macroexpand-all: detect a "defmacro" and add the corresponding macro to
>> macroexpand-all-environment for the rest of the expansion. Not sure
>> it'd be worth the trouble, but at least it would fix this "toplevel
>> special case".
>
> That's fine too, provided we handle the toplevel case correctly. Would
> you accept a change that did that?
That said, the CL way is much better. It's conceptually simpler to say
that defmacro at toplevel is well-defined (progn contents being
considered "toplevel") and everything else is undefined than to try to
support this defmacro stuff in *all* contexts and run into the exciting
corner inherent in your approach: cases involving nested macroexpand-all
calls in particular would be interesting. You worried about the level of
"detail" required to maintain this stuff, yet you're talking about
greatly increasing, relative to my change, the number of situations in
which we have to define macro expansion semantics. The CL toplevel
semantics are required to support real code: yours are not. Nobody is
going to write a defmacro at toplevel inside a cl-letf.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
next prev parent reply other threads:[~2014-04-22 18:13 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E1WcAcP-0006zy-MJ@vcs.savannah.gnu.org>
2014-04-21 15:09 ` [Emacs-diffs] trunk r117002: Correctly treat progn contents as toplevel forms when byte compiling Stefan Monnier
2014-04-21 17:44 ` Daniel Colascione
2014-04-21 22:09 ` Stefan Monnier
2014-04-21 22:29 ` Daniel Colascione
2014-04-22 2:09 ` Stefan Monnier
2014-04-22 2:21 ` Daniel Colascione
2014-04-22 4:25 ` Stefan Monnier
2014-04-22 4:46 ` Daniel Colascione
2014-04-22 15:06 ` Stefan Monnier
2014-04-22 17:22 ` Daniel Colascione
2014-04-22 18:13 ` Daniel Colascione [this message]
2014-04-22 18:37 ` Stefan Monnier
2014-04-22 19:08 ` Daniel Colascione
2014-04-22 18:44 ` Drew Adams
2014-04-22 19:23 ` Daniel Colascione
2014-04-22 19:59 ` Drew Adams
2014-04-22 20:10 ` Daniel Colascione
2014-04-22 20:41 ` Drew Adams
2014-04-22 21:05 ` Daniel Colascione
2014-04-23 0:50 ` Stephen J. Turnbull
2014-04-22 18:29 ` Stefan Monnier
2014-04-22 15:20 ` Stefan Monnier
2014-04-22 17:04 ` Daniel Colascione
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=5356B15B.7020802@dancol.org \
--to=dancol@dancol.org \
--cc=emacs-devel@gnu.org \
--cc=monnier@IRO.UMontreal.CA \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.