emacs-devel
[Top][All Lists]
Advanced

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

Re: Creating recursive customization types / widgets


From: Per Abrahamsen
Subject: Re: Creating recursive customization types / widgets
Date: Mon, 01 Dec 2003 12:36:39 +0100
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

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.

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.

> We should install this.

Yes.  It answers the most common custom/widget programming question
that I couldn't previously answer :-)

>> If the datastructures is recursive, you need to gave a :match argument
>> as well as :type.
>
> Why is that ?

Good question.  I was afraid of infinite recursion, but as long as the
widget type "eat some tokens" of the value before the recursion
starts, that doesn't happen.






reply via email to

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