Genericism or parameterized polymorphism is the newer trend. Macros or
templates are older.
C++ implements genercism and calls it templating. I disagree with this
terminology and believe there should be a distinction between the two.
With genericism the parameters form part of the "object" or rather classes
signature, with templating this should not be so in my view, templates
should allow implementation details to be added to a templated object, but
should not form part of the signature.
template< class T, int size> class Stack
{
public:
void push( T t) { ... }
private:
T *stack[size];
};
This mean that Stacks of different sizes are incompatible (I know this
could
be passed as a parameter to a constructor but this example is just for
purpose of illustration) you cannot copy or cast between them.
So what I am interested in in a new language is differentiating between
boilerplate type templating and genercism.
I have been exploring syntax for such an experimental language and will
post
some ideas later once I have seen what others have to say.
Aaron