[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating recursive customization types / widgets

From: Juri Linkov
Subject: Re: Creating recursive customization types / widgets
Date: Tue, 02 Dec 2003 02:31:33 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

Per Abrahamsen <address@hidden> writes:
> Per Abrahamsen <address@hidden> writes:
>> Stefan Monnier <address@hidden> 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?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]