* Re: [Emacs-diffs] master 1fcc552: lisp/gnus/registry.el (registry-prune): Allow registry to reach full size before pruning [not found] ` <E1YYuUz-0005J8-GO@vcs.savannah.gnu.org> @ 2015-03-20 14:35 ` Stefan Monnier 2015-03-21 1:32 ` Eric Abrahamsen 2015-04-18 10:51 ` Ted Zlatanov 0 siblings, 2 replies; 7+ messages in thread From: Stefan Monnier @ 2015-03-20 14:35 UTC (permalink / raw) To: emacs-devel; +Cc: Eric Abrahamsen > + (if (> size (oref db :max-size)) Why do people use the :initarg rather than the slot name? (oref db max-size) works as well (actually better: it's implemented more efficiently). Stefan ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Emacs-diffs] master 1fcc552: lisp/gnus/registry.el (registry-prune): Allow registry to reach full size before pruning 2015-03-20 14:35 ` [Emacs-diffs] master 1fcc552: lisp/gnus/registry.el (registry-prune): Allow registry to reach full size before pruning Stefan Monnier @ 2015-03-21 1:32 ` Eric Abrahamsen 2015-03-21 2:46 ` Stefan Monnier 2015-04-18 10:51 ` Ted Zlatanov 1 sibling, 1 reply; 7+ messages in thread From: Eric Abrahamsen @ 2015-03-21 1:32 UTC (permalink / raw) To: emacs-devel Stefan Monnier <monnier@IRO.UMontreal.CA> writes: >> + (if (> size (oref db :max-size)) > > Why do people use the :initarg rather than the slot name? > > (oref db max-size) > > works as well (actually better: it's implemented more efficiently). Because we didn't know any better! For some value of "us"... I saw your recent patch to the registry files, but you only changed *some* of the calls to oref/oset to use slot names. That was confusing. I can change the rest of them over, if that's desirable. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Emacs-diffs] master 1fcc552: lisp/gnus/registry.el (registry-prune): Allow registry to reach full size before pruning 2015-03-21 1:32 ` Eric Abrahamsen @ 2015-03-21 2:46 ` Stefan Monnier 2015-03-21 14:12 ` Eric Abrahamsen 0 siblings, 1 reply; 7+ messages in thread From: Stefan Monnier @ 2015-03-21 2:46 UTC (permalink / raw) To: Eric Abrahamsen; +Cc: emacs-devel > I saw your recent patch to the registry files, but you only changed > *some* of the calls to oref/oset to use slot names. That was confusing. I have a local change which signals an error when such an `oref' is executed (but not when it's compiled). So I only bump into some of them. > I can change the rest of them over, if that's desirable. Yes, I hope you (or other people) can take it from there. Stefan ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Emacs-diffs] master 1fcc552: lisp/gnus/registry.el (registry-prune): Allow registry to reach full size before pruning 2015-03-21 2:46 ` Stefan Monnier @ 2015-03-21 14:12 ` Eric Abrahamsen 0 siblings, 0 replies; 7+ messages in thread From: Eric Abrahamsen @ 2015-03-21 14:12 UTC (permalink / raw) To: emacs-devel Stefan Monnier <monnier@IRO.UMontreal.CA> writes: >> I saw your recent patch to the registry files, but you only changed >> *some* of the calls to oref/oset to use slot names. That was confusing. > > I have a local change which signals an error when such an `oref' is > executed (but not when it's compiled). So I only bump into some > of them. > >> I can change the rest of them over, if that's desirable. > > Yes, I hope you (or other people) can take it from there. Done! ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Emacs-diffs] master 1fcc552: lisp/gnus/registry.el (registry-prune): Allow registry to reach full size before pruning 2015-03-20 14:35 ` [Emacs-diffs] master 1fcc552: lisp/gnus/registry.el (registry-prune): Allow registry to reach full size before pruning Stefan Monnier 2015-03-21 1:32 ` Eric Abrahamsen @ 2015-04-18 10:51 ` Ted Zlatanov 2015-04-18 14:20 ` Stefan Monnier 1 sibling, 1 reply; 7+ messages in thread From: Ted Zlatanov @ 2015-04-18 10:51 UTC (permalink / raw) To: emacs-devel On Fri, 20 Mar 2015 10:35:59 -0400 Stefan Monnier <monnier@IRO.UMontreal.CA> wrote: >> + (if (> size (oref db :max-size)) SM> Why do people use the :initarg rather than the slot name? SM> (oref db max-size) SM> works as well (actually better: it's implemented more efficiently). I used it because I found it in a manual. But I can't recall which manual and when, it's been a while. AND IT WORKED DAMMIT! :) If initargs are to be avoided, maybe a compilation warning there would be appropriate?[1] Ted [1] this is where you tell me one has been in place since 1992 :) ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Emacs-diffs] master 1fcc552: lisp/gnus/registry.el (registry-prune): Allow registry to reach full size before pruning 2015-04-18 10:51 ` Ted Zlatanov @ 2015-04-18 14:20 ` Stefan Monnier 2015-04-18 14:34 ` Ted Zlatanov 0 siblings, 1 reply; 7+ messages in thread From: Stefan Monnier @ 2015-04-18 14:20 UTC (permalink / raw) To: emacs-devel > If initargs are to be avoided, maybe a compilation warning there would > be appropriate?[1] Agreed. I haven't implemented one yet, but it's crossed my mind, yes. The main problem is that in (oref a b), the compiler has no idea what is the possible class(es) of `a', so it can't look up that class to see if `b' is an initarg. What I'm thinking of doing is keeping track of all known slot names and all known initarg names, and if `b' is an initarg name but not a slot name, then emit the warning. This should work OK in practice since initargs tend to all be keywords, where slot names tend to all be non-keyword symbols. Stefan ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Emacs-diffs] master 1fcc552: lisp/gnus/registry.el (registry-prune): Allow registry to reach full size before pruning 2015-04-18 14:20 ` Stefan Monnier @ 2015-04-18 14:34 ` Ted Zlatanov 0 siblings, 0 replies; 7+ messages in thread From: Ted Zlatanov @ 2015-04-18 14:34 UTC (permalink / raw) To: emacs-devel On Sat, 18 Apr 2015 10:20:30 -0400 Stefan Monnier <monnier@IRO.UMontreal.CA> wrote: >> If initargs are to be avoided, maybe a compilation warning there would >> be appropriate?[1] SM> Agreed. I haven't implemented one yet, but it's crossed my mind, yes. SM> The main problem is that in (oref a b), the compiler has no idea what is SM> the possible class(es) of `a', so it can't look up that class to see if SM> `b' is an initarg. SM> What I'm thinking of doing is keeping track of all known slot names and SM> all known initarg names, and if `b' is an initarg name but not a slot SM> name, then emit the warning. This should work OK in practice since SM> initargs tend to all be keywords, where slot names tend to all be SM> non-keyword symbols. That would work for me as a user, but I fear it will be pretty hard to implement. Ted ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-04-18 14:34 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <20150320104953.20367.194@vcs.savannah.gnu.org> [not found] ` <E1YYuUz-0005J8-GO@vcs.savannah.gnu.org> 2015-03-20 14:35 ` [Emacs-diffs] master 1fcc552: lisp/gnus/registry.el (registry-prune): Allow registry to reach full size before pruning Stefan Monnier 2015-03-21 1:32 ` Eric Abrahamsen 2015-03-21 2:46 ` Stefan Monnier 2015-03-21 14:12 ` Eric Abrahamsen 2015-04-18 10:51 ` Ted Zlatanov 2015-04-18 14:20 ` Stefan Monnier 2015-04-18 14:34 ` Ted Zlatanov
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).