object scripts

Dan Shafer revolutionary.dan at gmail.com
Sun Feb 26 13:39:39 EST 2006


Mark....

Interesting implementation. My guess is that it's not going to be very
efficient in execution, but perhaps we just throw more hardware at it
as someone else has suggested.

The real problem for me is that it's not possible to create subclasses
of components. The recently departed Xavier spent a lot of years
trying to get that to work and although he came very close to a decent
simulation, actually implementing objects in a language not designed
for them leads to things like C++, which was procedural C with objects
glued clumsily to its side.

On 2/26/06, Mark Wieder <mwieder at ahsoftware.net> wrote:
> Geoff-
>
> Sunday, February 26, 2006, 12:20:10 AM, you wrote:
>
> > Heck, I think I could implement a significant chunk of OO in Rev as
> > it stands right now, and it wouldn't even take that long. Just insert
> > a front script, tag an object with a custom property representing its
> > "class," test the class of the target in the front script to call the
> > appropriate class routine, and encapsulate values in custom
> > properties. Automatic inheritance might be a bit tricky, but I'm sure
> > something could be worked out.
>
> > That would go a long way toward the principals of OO without having
> > to change anything.
>
> That's sort of what I'm doing now. Inheritance is actually fairly
> easy. The hard part is that scripts are associated with screen objects
> - you can't have objects that don't have screen representations.
>
> For instance, I have a linked-list class that I use as a base class
> for other classes. But there's no way to inherit the script without
> making both the base and sub classes scripts of buttons or something
> else. And adjusting front- and back- scripts accordingly. And paying
> *very* careful attention to the message path.
>
> -- Inheritance routines
> local aClasses -- array of class/parent pairs
>
> -- assign a parent class to a new class
> on ClassFactory pNewClass, pParent
>   put pNewClass into aClasses[pParent]
> end ClassFactory
>
> -- determine immediate parent class
> function GetParent pClass
>   if aClasses[pClass] is not empty then
>     put aClasses[pClass] into pClass
>   end if
>   return pClass
> end GetParent
>
> -- determine base class, if any
> function GetBaseClass pClass
>   repeat while aClasses[pClass] is not empty
>     put aClasses[pClass] into pClass
>   end repeat
>   return pClass
> end GetBaseClass
>
> --
> -Mark Wieder
>  mwieder at ahsoftware.net
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>


--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dan Shafer, Information Product Consultant and Author
http://www.shafermedia.com
Get my book, "Revolution: Software at the Speed of Thought"
>From http://www.shafermediastore.com/tech_main.html



More information about the use-livecode mailing list