From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Creating recursive customization types / widgets Date: Tue, 02 Dec 2003 02:31:33 +0200 Organization: JURTA Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87smk4oyai.fsf@mail.jurta.org> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1070338774 19733 80.91.224.253 (2 Dec 2003 04:19:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 2 Dec 2003 04:19:34 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Dec 02 05:19:31 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AR20Z-0002NS-00 for ; Tue, 02 Dec 2003 05:19:31 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AR20Z-0005Jg-00 for ; Tue, 02 Dec 2003 05:19:31 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AR2YL-0006XF-0X for emacs-devel@quimby.gnus.org; Mon, 01 Dec 2003 23:54:25 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AR02B-0007MI-Ve for emacs-devel@gnu.org; Mon, 01 Dec 2003 21:13:03 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AQzsq-0005vb-Tp for emacs-devel@gnu.org; Mon, 01 Dec 2003 21:03:56 -0500 Original-Received: from [64.246.52.22] (helo=ns5.tangramltd.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1AQzRT-0002P6-B8 for emacs-devel@gnu.org; Mon, 01 Dec 2003 20:35:07 -0500 Original-Received: from 80-235-32-220-dsl.mus.estpak.ee ([80.235.32.220] helo=mail.jurta.org) by ns5.tangramltd.com with esmtp (Exim 4.20) id 1AQyTr-0004yq-RI; Tue, 02 Dec 2003 02:33:32 +0200 Original-To: Per Abrahamsen In-Reply-To: (Per Abrahamsen's message of "Mon, 01 Dec 2003 18:08:37 +0100") User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ns5.tangramltd.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - jurta.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:18256 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:18256 Per Abrahamsen writes: > Per Abrahamsen writes: >> Stefan Monnier 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/