Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Languages Misc > Don't scrap you...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 1087 of 1154
Post > Topic >>

Don't scrap your boilerplate - Genercism .v. Templates

by "Aaron Gray" <ang.usenet@[EMAIL PROTECTED] > Dec 27, 2007 at 05:34 PM

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




 2 Posts in Topic:
Don't scrap your boilerplate - Genercism .v. Templates
"Aaron Gray" &l  2007-12-27 17:34:17 
Re: Don't scrap your boilerplate - Genercism .v. Templates
thomas.mertes@[EMAIL PROT  2008-01-03 02:05:49 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed May 14 22:34:45 CDT 2008.