From: David Engster <deng@randomsample.de>
To: Ted Zlatanov <tzz@lifelogs.com>
Cc: ding@gnus.org, emacs-devel@gnu.org
Subject: Re: bizarre byte-compile issue, possibly due to EIEIO
Date: Tue, 05 Apr 2011 18:38:23 +0200 [thread overview]
Message-ID: <87lizomz5s.fsf@randomsample.de> (raw)
In-Reply-To: <87oc4k66at.fsf@lifelogs.com> (Ted Zlatanov's message of "Tue, 05 Apr 2011 10:56:10 -0500")
Ted Zlatanov writes:
> On Mon, 04 Apr 2011 17:34:10 +0200 David Engster <deng@randomsample.de> wrote:
>
> DE> I wasn't thinking. The constructor has to check if there was an initarg
> DE> provided for 'data', otherwise it will overwrite it. Hence you have to
> DE> use something like
>
> DE> (defmethod initialize-instance :after ((this registry-db) slots)
> DE> "Set value of data slot of THIS after initialization."
> DE> ;; 'data' will already be set if read from file, so don't overwrite it.
> DE> (with-slots (data tracker) this
> DE> (unless (member :data slots)
> DE> (setq data (make-hash-table :size 10000 :rehash-size 2.0 :test 'equal)))
> DE> (unless (member :tracker slots)
> DE> (setq tracker (make-hash-table :size 100 :rehash-size 2.0)))))
>
> DE> This is also why you shouldn't set the other slot values here.
[...]
> I took your advice on both the constructor and the type. The updates
> plus some bug fixes are pushed. I'll test it a bit and if it works OK
> will merge the "tzz-gnus-registry-rewrite" branch into "master".
I saw that you now set every slot value in the :after method. This isn't
necessary; :initform is absolutely save to use for symbols. The only
thing that changed in EIEIO is for the case where :initform is a
function which has to be evaluated, which is only working correctly in
newer versions.
-David
next prev parent reply other threads:[~2011-04-05 16:38 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-01 20:29 bizarre byte-compile issue, possibly due to EIEIO Ted Zlatanov
2011-04-01 20:31 ` Ted Zlatanov
2011-04-01 20:50 ` Lars Magne Ingebrigtsen
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
2011-04-05 15:56 ` Ted Zlatanov
2011-04-05 16:38 ` David Engster [this message]
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lizomz5s.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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).