Subject: Not Even Exactly Sure Tbh

Here’s my problem:

I’m writing some simple Mathematics classes to ease me into flex, and whence they’re finished I’ll have a nice little library of junk that’s familiar to me, but I’m anticipating a problem involving the automatic invoking of the super() function in a constructor.

What I have so far, or at least what I will have, is a few classes representing a Set object, one robust and slow for dealing with and containing all kinds of my other objects (quaternions, tensors, ect), which accepts any kind of element and stores it, checking its type, removing all duplicates that were entered into the constructor (arguments can be passed as an array), and producing the end array at the end representing the elements in the set. I also have a NumericSet class which is purely for real numbers which of course is much more lightweight and runs ten times faster, and various other versions of the same thing with different degrees of efficiency for compile time optimisation, if I know in advance what’s going to be put in there.

As a result, NumericSet and others isn’t a subclass of Set because it would automatically invoke the super() function and run through my Set constructor, and typechecking every element redundantly, thus destroying any efficiency I obtained from doing it this way.

So, why do I care? The problem lies in that I will soon want to write a class to represent a group, which will have two properties, a set, and a binary operation on that set, so when I declare the property in my Group class, as var G:Set; this will not work for my other set classes which are not subclasses of Set, and therefore I would have to make this four times over.

I could coerce NumericSet into type Set when it passes to the Group constructor, but this again makes my optimisation redundant because I’m never really going to use this class not in conjunction with another more complex structure. So I need some way of rendering the automatic super() invoke inert, or some other workaround you smart people have that can’t see yet.

Thank you for your time, Dan