[Gambas-user] How do I override an Array class?

Emil Lenngren emil.lenngren at ...626...
Mon Jun 18 14:32:21 CEST 2012


 Even if most projects don't need more than depth 16, there might be some
very large projects (like Bruce's) that need it. Even well-designed
projects can have a large class tree.

And it is relatively easy to make that algorithm max depth-independent.
First see at what depth the current class is at, then declare a
variable-size array (directly on the stack, not with malloc) with the depth
as size, then fill it with all parents.

/Emil


2012/6/18 Benoît Minisini <gambas at ...1...>

> Le 18/06/2012 13:24, Emil Lenngren a écrit :
> > What is the real reason for limiting inheritance to max 16 levels? I see
> no
> > problem having no limit at all.
> >
> > /Emil
> >
>
> 16 is arbitrary, but a limit is necessary for one algorithm in class
> inheritance management.
>
> Anyway if you need more than 16 inheritance level, you may have a
> problem somewhere in your design...
>
> --
> Benoît Minisini
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list