unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* :tracker in eieio classes
@ 2016-02-12  5:44 Lars Ingebrigtsen
  2016-02-12  6:49 ` Eric Abrahamsen
  0 siblings, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2016-02-12  5:44 UTC (permalink / raw)
  To: emacs-devel; +Cc: David Engster

When compiling registry.el, I get the following:

ELC      gnus/registry.elc

In toplevel form:
gnus/registry.el:182:21:Warning: Unknown slot `:tracker'

I'm not very familiar with eieio, so I have no idea whether this is a
real bug or what to do about it.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




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

* Re: :tracker in eieio classes
  2016-02-12  5:44 :tracker in eieio classes Lars Ingebrigtsen
@ 2016-02-12  6:49 ` Eric Abrahamsen
  2016-02-12  7:32   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Abrahamsen @ 2016-02-12  6:49 UTC (permalink / raw)
  To: emacs-devel

Lars Ingebrigtsen <larsi@gnus.org> writes:

> When compiling registry.el, I get the following:
>
> ELC      gnus/registry.elc
>
> In toplevel form:
> gnus/registry.el:182:21:Warning: Unknown slot `:tracker'
>
> I'm not very familiar with eieio, so I have no idea whether this is a
> real bug or what to do about it.

I've noticed that, while tag references to slots work, the compiler
wants a symbol. I think if you just switch that to (oref db 'tracker) it
should be quiet. Or (eieio-oref db 'tracker).

Eric




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

* Re: :tracker in eieio classes
  2016-02-12  6:49 ` Eric Abrahamsen
@ 2016-02-12  7:32   ` Lars Ingebrigtsen
  2016-02-12  7:39     ` Chris Feng
  0 siblings, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2016-02-12  7:32 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: emacs-devel

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> I've noticed that, while tag references to slots work, the compiler
> wants a symbol. I think if you just switch that to (oref db 'tracker) it
> should be quiet. Or (eieio-oref db 'tracker).

Then it says

In toplevel form:
gnus/registry.el:182:21:Warning: Unknown slot `(quote tracker)'

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



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

* Re: :tracker in eieio classes
  2016-02-12  7:32   ` Lars Ingebrigtsen
@ 2016-02-12  7:39     ` Chris Feng
  2016-02-12  8:47       ` Eric Abrahamsen
  2016-02-13  3:46       ` Lars Ingebrigtsen
  0 siblings, 2 replies; 8+ messages in thread
From: Chris Feng @ 2016-02-12  7:39 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Eric Abrahamsen, emacs-devel

>> I've noticed that, while tag references to slots work, the compiler
>> wants a symbol. I think if you just switch that to (oref db 'tracker) it
>> should be quiet. Or (eieio-oref db 'tracker).
>
> Then it says
>
> In toplevel form:
> gnus/registry.el:182:21:Warning: Unknown slot `(quote tracker)'

It should be (oref db tracker).



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

* Re: :tracker in eieio classes
  2016-02-12  7:39     ` Chris Feng
@ 2016-02-12  8:47       ` Eric Abrahamsen
  2016-02-13  3:46       ` Lars Ingebrigtsen
  1 sibling, 0 replies; 8+ messages in thread
From: Eric Abrahamsen @ 2016-02-12  8:47 UTC (permalink / raw)
  To: emacs-devel

Chris Feng <chris.w.feng@gmail.com> writes:

>>> I've noticed that, while tag references to slots work, the compiler
>>> wants a symbol. I think if you just switch that to (oref db 'tracker) it
>>> should be quiet. Or (eieio-oref db 'tracker).
>>
>> Then it says
>>
>> In toplevel form:
>> gnus/registry.el:182:21:Warning: Unknown slot `(quote tracker)'
>
> It should be (oref db tracker).

Whoops, sorry for the hasty answer. I usually use eieio-oref, which
is a function and wants a symbol. `oref' is defined as a macro:

(defmacro oref (obj slot)
  (declare (debug (form symbolp)))
  `(eieio-oref ,obj (quote ,slot)))

I've always been a little confused about whether one thing or the other
was preferred.




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

* Re: :tracker in eieio classes
  2016-02-12  7:39     ` Chris Feng
  2016-02-12  8:47       ` Eric Abrahamsen
@ 2016-02-13  3:46       ` Lars Ingebrigtsen
  2016-02-13  3:59         ` Eric Abrahamsen
  1 sibling, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2016-02-13  3:46 UTC (permalink / raw)
  To: Chris Feng; +Cc: Eric Abrahamsen, emacs-devel

Chris Feng <chris.w.feng@gmail.com> writes:

>>> I've noticed that, while tag references to slots work, the compiler
>>> wants a symbol. I think if you just switch that to (oref db 'tracker) it
>>> should be quiet. Or (eieio-oref db 'tracker).
>>
>> Then it says
>>
>> In toplevel form:
>> gnus/registry.el:182:21:Warning: Unknown slot `(quote tracker)'
>
> It should be (oref db tracker).

There's also code like:

(cl-defmethod initialize-instance :after ((this registry-db) slots)
  "Set value of data slot of THIS after initialization."
  (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)))))

That should be 'tracker in that `member', perhaps?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



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

* Re: :tracker in eieio classes
  2016-02-13  3:46       ` Lars Ingebrigtsen
@ 2016-02-13  3:59         ` Eric Abrahamsen
  2016-02-13  5:05           ` Lars Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Abrahamsen @ 2016-02-13  3:59 UTC (permalink / raw)
  To: emacs-devel

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Chris Feng <chris.w.feng@gmail.com> writes:
>
>>>> I've noticed that, while tag references to slots work, the compiler
>>>> wants a symbol. I think if you just switch that to (oref db 'tracker) it
>>>> should be quiet. Or (eieio-oref db 'tracker).
>>>
>>> Then it says
>>>
>>> In toplevel form:
>>> gnus/registry.el:182:21:Warning: Unknown slot `(quote tracker)'
>>
>> It should be (oref db tracker).
>
> There's also code like:
>
> (cl-defmethod initialize-instance :after ((this registry-db) slots)
>   "Set value of data slot of THIS after initialization."
>   (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)))))
>
> That should be 'tracker in that `member', perhaps?

No, "slots" is a plist, not an object.




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

* Re: :tracker in eieio classes
  2016-02-13  3:59         ` Eric Abrahamsen
@ 2016-02-13  5:05           ` Lars Ingebrigtsen
  0 siblings, 0 replies; 8+ messages in thread
From: Lars Ingebrigtsen @ 2016-02-13  5:05 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: emacs-devel

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> No, "slots" is a plist, not an object.

Okidoke.  I've just changed the `oref' call, then.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



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

end of thread, other threads:[~2016-02-13  5:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-12  5:44 :tracker in eieio classes Lars Ingebrigtsen
2016-02-12  6:49 ` Eric Abrahamsen
2016-02-12  7:32   ` Lars Ingebrigtsen
2016-02-12  7:39     ` Chris Feng
2016-02-12  8:47       ` Eric Abrahamsen
2016-02-13  3:46       ` Lars Ingebrigtsen
2016-02-13  3:59         ` Eric Abrahamsen
2016-02-13  5:05           ` Lars Ingebrigtsen

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