Raul,

This may be a case where the word "closure" was used to indicate
state-specific features that occur as a matter of course in executing
J scripts, in which case you would be right that nothing is to be
added to support multiple inheritance in this manner.

On this topic, I've been aware that my solution to the multiple
inheritance task at Rosetta Code is weak. It occurs here:

http://www.rosettacode.org/wiki/Multiple_inheritance#J

The fact that I don't use coinsert suggests that I'm not handling this
right. However, I want the creation-specific code for both parent
classes to be executed when an object of type CameraPhone is created,
and I think using coinsert in the manner you described would result in
only one being effective. (I don't see that the situation here would
be fixed using the "closure-based inheritance" I mentioned recently.)

The technique I coded can be called "has a", for CameraPhone has a
Camera object and also has a MobilePhone object, as opposed to
instantiating both types of objects. The techniques I can envision for
the approach we'd call "is a" all seem to involve text processing that
composes the script for the object before execution. That does not
appeal to me. I hope I have overlooked some straightforward way to
accomplish this. (When it comes to J, that happens a lot.)

--
Tracy


On Mon, Dec 1, 2008 at 10:39 PM, Raul Miller <[EMAIL PROTECTED]> wrote:
>
> J already supports multiple inheritance, using a
> mechanism analogous to the one described in
> your quote.
>
> ...
> If you use coinsert multiple times, the later
> uses take precedence.
>
> But I guess I don't see that closures could
> add anything to this.
>
> --
> Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to