From: Juri Linkov <juri@jurta.org>
Cc: emacs-devel@gnu.org
Subject: Re: Creating recursive customization types / widgets
Date: Tue, 02 Dec 2003 02:31:33 +0200 [thread overview]
Message-ID: <87smk4oyai.fsf@mail.jurta.org> (raw)
In-Reply-To: <rjoeusmpnu.fsf@sheridan.dina.kvl.dk> (Per Abrahamsen's message of "Mon, 01 Dec 2003 18:08:37 +0100")
Per Abrahamsen <abraham@dina.kvl.dk> writes:
> Per Abrahamsen <abraham@dina.kvl.dk> writes:
>> Stefan Monnier <monnier@IRO.UMontreal.CA> writes:
>>> Neat. I have no idea why it's called `child' and the resulting
>>> use of `child' in (define-widget 'foo 'child ...) does not look
>>> particularly intuitive, but I can't think of anything better either.
>>
>> Because it has a single child widget, and the new widget basically
>> behave like the child, except for allowing recursion.
>
> Actually, now I remember. I though of it as a potential base class
> for all widgets with a single child. But it is not entirely
> appropriate for that.
The name "child" is not suitable in this case because it has
a sense only in a "parent-child" relationship between two entities.
So, let's consider some terminology to choose a better name:
Tree - recursive data structure
Node - item of a tree
Root - initial node of a tree
Leaf - terminal node of a tree
Cell - data object in Lisp data structure ("cons cell", "pair")
So depending on whether you perceive a new widget as a whole structure
(such as e.g. displayed by the `widget-browse-mode' in a widget
buffer) or only as one element of such structure, I suggest you
to name it either "tree" or "node".
>> I called it 'recursive' and 'delayed' under development.
>>
>> It is a common pattern in OOP. Having an object that wraps another
>> object, delegates message to the other object, and thus acts like a
>> proxy. So 'wrapper', delegator' or 'proxy' could be used as well.
>
> My current favorite name would be 'proxy', but I do not feel strongly
> about it. What do you think?
These names are too implementation-specific, but from user's point of view
the name "node" is more clear.
BTW, adding new nodes to a tree in this new widget is easy,
but I can't find a way to delete a node. Is it possible?
--
http://www.jurta.org/emacs/
next prev parent reply other threads:[~2003-12-02 0:31 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-29 16:38 Creating recursive customization types / widgets Per Abrahamsen
2003-11-29 18:34 ` Per Abrahamsen
2003-11-30 20:05 ` Stefan Monnier
2003-12-01 11:36 ` Per Abrahamsen
2003-12-01 16:35 ` Thien-Thi Nguyen
2003-12-02 12:37 ` tapsellferrier.co.uk Host name lookup failure Robert J. Chassell
2003-12-01 17:08 ` Creating recursive customization types / widgets Per Abrahamsen
2003-12-02 0:31 ` Juri Linkov [this message]
2003-12-02 10:19 ` Per Abrahamsen
2003-12-02 12:46 ` David Kastrup
2003-12-02 13:34 ` Per Abrahamsen
2003-12-02 10:40 ` Per Abrahamsen
2003-12-01 13:36 ` Per Abrahamsen
2003-12-01 16:10 ` Ted Zlatanov
2003-12-01 19:24 ` Per Abrahamsen
2003-12-01 1:45 ` Richard Stallman
2003-12-01 13:27 ` Per Abrahamsen
2003-12-02 4:17 ` Richard Stallman
2003-12-02 10:31 ` Per Abrahamsen
2003-12-03 4:46 ` Richard Stallman
2003-12-03 12:30 ` Per Abrahamsen
2003-12-03 15:26 ` Per Abrahamsen
2003-12-03 19:05 ` Kevin Rodgers
2003-12-02 11:24 ` David Kastrup
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=87smk4oyai.fsf@mail.jurta.org \
--to=juri@jurta.org \
--cc=emacs-devel@gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.