unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#10781: EIEIO namespace use
@ 2012-02-10 18:39 Stefan Monnier
  2012-04-28 10:28 ` David Engster
  0 siblings, 1 reply; 10+ messages in thread
From: Stefan Monnier @ 2012-02-10 18:39 UTC (permalink / raw)
  To: 10781

Package: Emacs
Severity: important
Version: 24.0.92

EIEIO needs to be cleaned up so it doesn't intrude all over
the namespace.
The worst offenders include:
- `this'.
- `slot-*'.
- `constructor', `destructor'.
- `delete-instance'.
- `initialize-instance'.
- `clone'.
- `data-debug*'.
- `make-instance'.
- `oref'.
- `oset'.
- `with-slots'.
- `object-*'.
- `class-*'.
- `next-method-p'.
- `call-next-method'.
- error symbols (like no-next-method).
- ... probably `defmethod', `defclass', and `defgeneric'.



In GNU Emacs 24.0.92.1 (i686-pc-linux-gnu, GTK+ Version 2.24.8)
 of 2012-01-17 on pastel
Windowing system distributor `The X.Org Foundation', version 11.0.11103901
Configured using:
 `configure
 'CFLAGS=-Wall -Wno-pointer-sign -DUSE_LISP_UNION_TYPE -DSYNC_INPUT -DENABLE_CHECKING -DXASSERTS -DFONTSET_DEBUG -g -O0'
 '--with-tiff=no''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: fr_CH.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: InactiveMinibuffer

Minor modes in effect:
  shell-dirtrack-mode: t
  diff-auto-refine-mode: t
  electric-pair-mode: t
  electric-indent-mode: t
  url-handler-mode: t
  global-reveal-mode: t
  reveal-mode: t
  auto-insert-mode: t
  savehist-mode: t
  minibuffer-electric-default-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> C-u M-x 
i n f <tab> o <return> C-g C-g <switch-frame> <switch-frame> 
<select-window> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> C-u C-x 
5 1 <switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <help-echo> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<help-echo> <switch-frame> <help-echo> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> C-s a 
u t o m a t i c C-a <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> C-s e i e i o <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <left> <left> <left> 
<left> <left> <left> <left> <left> <left> <left> <left> 
<left> <left> C-s C-w C-w C-w SPC " e i e i <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <select-window> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> C-x 5 
f e / e i e o <backspace> i <tab> . <tab> <return> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <switch-frame> <switch-frame> <switch-frame> 
<switch-frame> <help-echo> <switch-frame> M-x r e p 
- e m - b u <tab> <return>

Recent messages:
Mark set [2 times]
Saving file /home/monnier/cours/ift-2245/H2012/index.html...
Wrote /home/monnier/cours/ift-2245/H2012/index.html
Warning: interactive-p is obsolete! [9 times]
Making completion list...
Quit [2 times]
Warning: interactive-p is obsolete!
Mark saved where search started
Warning: interactive-p is obsolete! [3 times]
Mark saved where search started [2 times]

Load-path shadows:
None found.

Features:
(url-dav xml network-stream starttls url-cache url-http tls url
url-proxy url-privacy url-history mailcap url-auth url-cookie url-gw
url-expand url-methods url-util completion dos-w32 find-cmd lisp-mnt
log-edit pcvs-util add-log wdired ls-lisp find-dired dired-aux dired-x
typer-mode epa-file epa epg epg-config vc-dir descr-text informat
texinfo vc-sccs vc-svn vc-cvs vc-rcs cal-china lunar solar cal-dst
cal-bahai cal-islam cal-hebrew holidays hol-loaddefs cal-french
diary-lib diary-loaddefs cal-move cal-menu calendar cal-loaddefs sort
mail-extr message sendmail rfc822 mml mml-sec mm-decode mm-bodies
mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mail-utils
mailheader emacsbug sh-script conf-mode hideif cpp cmacexp cc-mode
cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars
cc-defs sgml-mode format-spec reftex-vcr reftex-dcr reftex reftex-vars
tex-mode latexenc bbdb-com mailabbrev bbdb timezone whitespace
autorevert doc-view jka-compr image-mode dired cl-specs xscheme trace
testcover scheme unsafep re-builder shadow inf-lisp ielm pp gmm-utils
ert find-func ewoc elp edebug cust-print repeat debug quail rect
multi-isearch dabbrev shell pcomplete vc ediff-merg ediff-diff
ediff-wind ediff-help ediff-util ediff-mult ediff-init ediff
vc-dispatcher executable copyright cus-edit cus-start cus-load wid-edit
smerge-mode newcomment diff-mode vc-bzr filecache mule-util caml tuareg
speedbar sb-image ezimage dframe skeleton compile comint ring derived
smie caml-help caml-types caml-emacs server noutline outline easy-mmode
flyspell ispell eldoc checkdoc regexp-opt thingatpt help-mode view
prog-mode load-dir electric url-handlers url-parse auth-source warnings
eieio byte-opt bytecomp byte-compile cconv macroexp assoc gnus-util
password-cache url-vars mm-util mail-prsvr reveal autoinsert uniquify
advice help-fns advice-preload time-date savehist minibuf-eldef
disp-table cl cl-loaddefs all-autoloads company-autoloads
debbugs-autoloads epoch-view-autoloads jgraph-mode-autoloads
js2-mode-autoloads lmc-autoloads load-dir-autoloads markchars-autoloads
minimap-autoloads muse-autoloads info easymenu oauth2-autoloads
quarter-plane-autoloads rainbow-mode-autoloads register-list-autoloads
sisu-mode-autoloads svg-clock-autoloads undo-tree-autoloads
uni-confusables-autoloads windresize-autoloads package tabulated-list
proof-site proof-autoloads pg-vars bbdb-autoloads agda2 tooltip
ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd
fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer
select scroll-bar mouse jit-lock font-lock syntax font-core frame cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple
abbrev minibuffer loaddefs button faces cus-face files text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
dynamic-setting system-font-setting font-render-setting move-toolbar gtk
x-toolkit x multi-tty emacs)





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

* bug#10781: EIEIO namespace use
  2012-02-10 18:39 bug#10781: EIEIO namespace use Stefan Monnier
@ 2012-04-28 10:28 ` David Engster
  2012-04-28 12:29   ` Eric M. Ludlam
  2012-04-28 15:22   ` Stefan Monnier
  0 siblings, 2 replies; 10+ messages in thread
From: David Engster @ 2012-04-28 10:28 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 10781, Eric M. Ludlam

Stefan Monnier writes:
> EIEIO needs to be cleaned up so it doesn't intrude all over
> the namespace.
> The worst offenders include:
> - `this'.
> - `slot-*'.
> - `constructor', `destructor'.
> - `delete-instance'.
> - `initialize-instance'.
> - `clone'.
> - `data-debug*'.
> - `make-instance'.
> - `oref'.
> - `oset'.
> - `with-slots'.
> - `object-*'.
> - `class-*'.
> - `next-method-p'.
> - `call-next-method'.
> - error symbols (like no-next-method).
> - ... probably `defmethod', `defclass', and `defgeneric'.

I think this should be a goal for the next merge, but I'm at a loss
regarding how this should be tackled without, you know, breaking
practically every bit of code in CEDET and probably others. Do you have
a suggestion? Maybe even creating EIEIOv2 and slowly porting CEDET to
that?

-David





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

* bug#10781: EIEIO namespace use
  2012-04-28 10:28 ` David Engster
@ 2012-04-28 12:29   ` Eric M. Ludlam
  2012-04-28 15:22   ` Stefan Monnier
  1 sibling, 0 replies; 10+ messages in thread
From: Eric M. Ludlam @ 2012-04-28 12:29 UTC (permalink / raw)
  To: David Engster; +Cc: 10781

On 04/28/2012 06:28 AM, David Engster wrote:
> Stefan Monnier writes:
>> EIEIO needs to be cleaned up so it doesn't intrude all over
>> the namespace.
>> The worst offenders include:
>> - `this'.
>> - `slot-*'.
>> - `constructor', `destructor'.
>> - `delete-instance'.
>> - `initialize-instance'.
>> - `clone'.
>> - `data-debug*'.
>> - `make-instance'.
>> - `oref'.
>> - `oset'.
>> - `with-slots'.
>> - `object-*'.
>> - `class-*'.
>> - `next-method-p'.
>> - `call-next-method'.
>> - error symbols (like no-next-method).
>> - ... probably `defmethod', `defclass', and `defgeneric'.
>
> I think this should be a goal for the next merge, but I'm at a loss
> regarding how this should be tackled without, you know, breaking
> practically every bit of code in CEDET and probably others. Do you have
> a suggestion? Maybe even creating EIEIOv2 and slowly porting CEDET to
> that?

Many symbols in eieio are the names given by CLOS, like 
initialize-instance, make-instance, with-slots, and call-next-method. 
Other names like oref/oset were meant to fill gaps where Emacs couldn't 
do it the clos way.  If Emacs is to have a good way to do some basic OO 
programming, it seems to me that the names would match up with other 
core functions that crowd the core namespace, and it would seem poor to 
fill your oo code with a bunch of unnecessarily long names.

That said, there are certainly plenty that could be removed, and I would 
not be sad to see them go... like 'this' and a few of the class-* and 
object-* functions.  Some already have eieio-* equivalents, but I didn't 
finish that.

Eric





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

* bug#10781: EIEIO namespace use
  2012-04-28 10:28 ` David Engster
  2012-04-28 12:29   ` Eric M. Ludlam
@ 2012-04-28 15:22   ` Stefan Monnier
  2012-04-28 15:55     ` David Engster
  1 sibling, 1 reply; 10+ messages in thread
From: Stefan Monnier @ 2012-04-28 15:22 UTC (permalink / raw)
  To: 10781; +Cc: Eric M. Ludlam

>> EIEIO needs to be cleaned up so it doesn't intrude all over
>> the namespace.
>> The worst offenders include:
>> - `this'.
>> - `slot-*'.
>> - `constructor', `destructor'.
>> - `delete-instance'.
>> - `initialize-instance'.
>> - `clone'.
>> - `data-debug*'.
>> - `make-instance'.
>> - `oref'.
>> - `oset'.
>> - `with-slots'.
>> - `object-*'.
>> - `class-*'.
>> - `next-method-p'.
>> - `call-next-method'.
>> - error symbols (like no-next-method).
>> - ... probably `defmethod', `defclass', and `defgeneric'.

> I think this should be a goal for the next merge, but I'm at a loss
> regarding how this should be tackled without, you know, breaking
> practically every bit of code in CEDET and probably others.  Do you
> have a suggestion? Maybe even creating EIEIOv2 and slowly porting
> CEDET to that?

We'll hopefully be moving the CL library to a new `cl-lib' which uses
the "cl-" prefix consistently.  Maybe EIEIO can use the same prefix for
those cases where "eieio-" would be inconvenient?
This said, the most pressing issue is `this'.


        Stefan





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

* bug#10781: EIEIO namespace use
  2012-04-28 15:22   ` Stefan Monnier
@ 2012-04-28 15:55     ` David Engster
  2012-04-28 19:43       ` Stefan Monnier
  0 siblings, 1 reply; 10+ messages in thread
From: David Engster @ 2012-04-28 15:55 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 10781, Eric M. Ludlam

Stefan Monnier writes:
>>> EIEIO needs to be cleaned up so it doesn't intrude all over
>>> the namespace.
>>> The worst offenders include:
>
>>> - `this'.
>>> - `slot-*'.
>>> - `constructor', `destructor'.
>>> - `delete-instance'.
>>> - `initialize-instance'.
>>> - `clone'.
>>> - `data-debug*'.
>>> - `make-instance'.
>>> - `oref'.
>>> - `oset'.
>>> - `with-slots'.
>>> - `object-*'.
>>> - `class-*'.
>>> - `next-method-p'.
>>> - `call-next-method'.
>>> - error symbols (like no-next-method).
>>> - ... probably `defmethod', `defclass', and `defgeneric'.
>
>> I think this should be a goal for the next merge, but I'm at a loss
>> regarding how this should be tackled without, you know, breaking
>> practically every bit of code in CEDET and probably others.  Do you
>> have a suggestion? Maybe even creating EIEIOv2 and slowly porting
>> CEDET to that?
>
> We'll hopefully be moving the CL library to a new `cl-lib' which uses
> the "cl-" prefix consistently.  Maybe EIEIO can use the same prefix for
> those cases where "eieio-" would be inconvenient?
> This said, the most pressing issue is `this'.

Yes, I think 'this' should indeed become 'eieio-this'. It will also be
the most work, since at least in CEDET you *very* often have

(defmethod foo ((this someclass) ...)
 ...)

so a 'this' in such a method is perfectly fine.

-David





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

* bug#10781: EIEIO namespace use
  2012-04-28 15:55     ` David Engster
@ 2012-04-28 19:43       ` Stefan Monnier
  2012-04-28 21:03         ` David Engster
  0 siblings, 1 reply; 10+ messages in thread
From: Stefan Monnier @ 2012-04-28 19:43 UTC (permalink / raw)
  To: David Engster; +Cc: 10781, Eric M. Ludlam

> Yes, I think 'this' should indeed become 'eieio-this'. It will also be
> the most work, since at least in CEDET you *very* often have

> (defmethod foo ((this someclass) ...)
>  ...)

> so a 'this' in such a method is perfectly fine.

An alternative approach is to keep the name `this' but get rid of the
global definition.  I.e. Either completely remove the (defvar this nil),
or replace it with (defvar this).


        Stefan





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

* bug#10781: EIEIO namespace use
  2012-04-28 19:43       ` Stefan Monnier
@ 2012-04-28 21:03         ` David Engster
  2012-04-28 22:29           ` Eric M. Ludlam
  0 siblings, 1 reply; 10+ messages in thread
From: David Engster @ 2012-04-28 21:03 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 10781, Eric M. Ludlam

Stefan Monnier writes:
>> Yes, I think 'this' should indeed become 'eieio-this'. It will also be
>> the most work, since at least in CEDET you *very* often have
>
>> (defmethod foo ((this someclass) ...)
>>  ...)
>
>> so a 'this' in such a method is perfectly fine.
>
> An alternative approach is to keep the name `this' but get rid of the
> global definition.  I.e. Either completely remove the (defvar this nil),
> or replace it with (defvar this).

Eric, what would you prefer? I don't know enough about CLOS to say how
important a global 'eieio-this' actually is. Either way, I just tested
both solutions on CEDET trunk and each produced exactly this single
compile warning:

In ede-flush-directory-hash:
files.el:230:38:Warning: reference to free variable `this'

So actually, this appears to be a much smaller issue than I initially
thought. It seems pretty much every 'this' in CEDET is already bound in
the defmethod's argument list.

-David





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

* bug#10781: EIEIO namespace use
  2012-04-28 21:03         ` David Engster
@ 2012-04-28 22:29           ` Eric M. Ludlam
  2012-04-29  8:06             ` David Engster
  0 siblings, 1 reply; 10+ messages in thread
From: Eric M. Ludlam @ 2012-04-28 22:29 UTC (permalink / raw)
  To: David Engster; +Cc: 10781

On 04/28/2012 05:03 PM, David Engster wrote:
> Stefan Monnier writes:
>>> Yes, I think 'this' should indeed become 'eieio-this'. It will also be
>>> the most work, since at least in CEDET you *very* often have
>>
>>> (defmethod foo ((this someclass) ...)
>>>   ...)
>>
>>> so a 'this' in such a method is perfectly fine.
>>
>> An alternative approach is to keep the name `this' but get rid of the
>> global definition.  I.e. Either completely remove the (defvar this nil),
>> or replace it with (defvar this).
>
> Eric, what would you prefer? I don't know enough about CLOS to say how
> important a global 'eieio-this' actually is. Either way, I just tested
> both solutions on CEDET trunk and each produced exactly this single
> compile warning:
>
> In ede-flush-directory-hash:
> files.el:230:38:Warning: reference to free variable `this'
>
> So actually, this appears to be a much smaller issue than I initially
> thought. It seems pretty much every 'this' in CEDET is already bound in
> the defmethod's argument list.

I would be happy to see 'this' just completely removed.  It was put in 
when I was mimicing C++, and some old programs of mine that have long 
since rotted away depended on it.  I'm actually surprised there was a 
reference to it in CEDET still.  That will be good to clean up.

Eric





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

* bug#10781: EIEIO namespace use
  2012-04-28 22:29           ` Eric M. Ludlam
@ 2012-04-29  8:06             ` David Engster
  2012-04-29 12:14               ` Eric Ludlam
  0 siblings, 1 reply; 10+ messages in thread
From: David Engster @ 2012-04-29  8:06 UTC (permalink / raw)
  To: Eric M. Ludlam; +Cc: 10781

Eric M. Ludlam writes:
> I would be happy to see 'this' just completely removed.  It was put in
> when I was mimicing C++, and some old programs of mine that have long
> since rotted away depended on it.  I'm actually surprised there was a
> reference to it in CEDET still.  That will be good to clean up.

OK, I will take care of that.

And while I'm at it: What about 'scoped-class'? It is only used in
`eieio-slot-name-index' and `call-next-method' in EIEIO itself, so it
could at least be made local? I'm not sure if it can be removed
completely.

-David






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

* bug#10781: EIEIO namespace use
  2012-04-29  8:06             ` David Engster
@ 2012-04-29 12:14               ` Eric Ludlam
  0 siblings, 0 replies; 10+ messages in thread
From: Eric Ludlam @ 2012-04-29 12:14 UTC (permalink / raw)
  To: David Engster; +Cc: 10781

  On 04/29/2012 04:06 AM, David Engster wrote:
> Eric M. Ludlam writes:
>> I would be happy to see 'this' just completely removed.  It was put in
>> when I was mimicing C++, and some old programs of mine that have long
>> since rotted away depended on it.  I'm actually surprised there was a
>> reference to it in CEDET still.  That will be good to clean up.
> OK, I will take care of that.
>
> And while I'm at it: What about 'scoped-class'? It is only used in
> `eieio-slot-name-index' and `call-next-method' in EIEIO itself, so it
> could at least be made local? I'm not sure if it can be removed
> completely.

That is an internal symbol... or should be, and can be renamed as such.

Thanks David!
Eric





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

end of thread, other threads:[~2012-04-29 12:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-10 18:39 bug#10781: EIEIO namespace use Stefan Monnier
2012-04-28 10:28 ` David Engster
2012-04-28 12:29   ` Eric M. Ludlam
2012-04-28 15:22   ` Stefan Monnier
2012-04-28 15:55     ` David Engster
2012-04-28 19:43       ` Stefan Monnier
2012-04-28 21:03         ` David Engster
2012-04-28 22:29           ` Eric M. Ludlam
2012-04-29  8:06             ` David Engster
2012-04-29 12:14               ` Eric Ludlam

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