From: David Engster <deng@randomsample.de>
To: Ted Zlatanov <tzz@lifelogs.com>
Cc: emacs-devel@gnu.org, ding@gnus.org
Subject: Re: bizarre byte-compile issue, possibly due to EIEIO
Date: Mon, 04 Apr 2011 17:34:10 +0200 [thread overview]
Message-ID: <87tyeeyqrx.fsf@randomsample.de> (raw)
In-Reply-To: <8762qub9q5.fsf@lifelogs.com> (Ted Zlatanov's message of "Mon, 04 Apr 2011 05:18:42 -0500")
Ted Zlatanov writes:
> On Sun, 03 Apr 2011 11:34:42 +0200 David Engster <deng@randomsample.de> wrote:
>
> DE> Here's what I observe:
>
> DE> * The 'mapcar' method always works.
> DE> * If you don't byte-compile, the 'loop' method will also work.
> DE> * If you byte-compile, the 'loop' method will fail with Emacs24 *before*
> DE> the lexbind merge. After the lexbind merge, it works as expected.
>
> Of course, I found and reported all of this right before the lexbind
> merge. Argh.
Yes, but we can't be sure the "real bug" has been fixed here...
> DE> Note that the :initform evaluation will not work with the EIEIO version
> DE> which ships with Emacs23. I remember some discussions regarding this
> DE> issue; it's probably best to use an explicit constructor. I included it
> DE> in the test case (you have to uncomment it). When using the class w/
> DE> constructor, you can also compile it under Emacs23, and the 'loop'
> DE> method will then also fail.
>
> When I use the explicit constructor (commented out right now), many
> tests fail. Do you want to take a look at that? It's the only
> remaining merge blocker.
I wasn't thinking. The constructor has to check if there was an initarg
provided for 'data', otherwise it will overwrite it. Hence you have to
use something like
(defmethod initialize-instance :after ((this registry-db) slots)
"Set value of data slot of THIS after initialization."
;; 'data' will already be set if read from file, so don't overwrite it.
(with-slots (data tracker) this
(unless (member :data slots)
(setq data (make-hash-table :size 10000 :rehash-size 2.0 :test 'equal)))
(unless (member :tracker slots)
(setq tracker (make-hash-table :size 100 :rehash-size 2.0)))))
This is also why you shouldn't set the other slot values here.
BTW, you can use
:type hash-table
for 'tracker' and 'data'. It will then use 'hash-table-p' for checking
the provided argument.
> DE> The funny thing is that Emacs24 *after* the lexbind merge cannot run
> DE> that byte-compiled code from Emacs23; is that to be expected?
>
> I would assume major versions introduce binary incompatibilities, so I
> wouldn't worry about that.
The docs say: "In general, any version of Emacs can run byte-compiled
code produced by recent earlier versions of Emacs, but the reverse is
not true."
So I'm guessing this is one exception from this general rule. :-)
-David
next prev parent reply other threads:[~2011-04-04 15:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87hbahww99.fsf@lifelogs.com>
2011-04-02 0:54 ` Ted Zlatanov
2011-04-02 20:34 ` Lars Magne Ingebrigtsen
2011-04-04 13:47 ` Ted Zlatanov
2011-04-04 15:26 ` David Engster
2011-04-02 21:32 ` David Engster
2011-04-03 9:34 ` David Engster
2011-04-04 10:18 ` Ted Zlatanov
2011-04-04 15:34 ` David Engster [this message]
2011-04-05 15:56 ` Ted Zlatanov
2011-04-05 16:38 ` David Engster
2011-04-05 17:55 ` Ted Zlatanov
2011-04-05 18:31 ` David Engster
2011-04-05 18:44 ` Ted Zlatanov
2011-04-05 16:14 ` Ted Zlatanov
2011-04-05 17:57 ` Ted Zlatanov
2011-04-04 16:29 ` Stefan Monnier
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=87tyeeyqrx.fsf@randomsample.de \
--to=deng@randomsample.de \
--cc=ding@gnus.org \
--cc=emacs-devel@gnu.org \
--cc=tzz@lifelogs.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 NNTP newsgroup(s).