Re: Template classes

2009-04-16 Thread Jarrett Billingsley
On Thu, Apr 16, 2009 at 1:14 PM, Arild Boes wrote: > Actually the f-call syntactic sugar seems like a good way to keep core > classes of any library very lean and mean, whilst maintaining the ability to > expand the module without re-compiling the original library! (just import > this guy, and th

Re: Template classes

2009-04-16 Thread Arild Boes
Jarrett Billingsley skrev: On Wed, Apr 15, 2009 at 12:13 PM, Arild Boes wrote: Take a look at the 'this' of D2, it allows to create wrapper structs, so you can just add methods to the built-in arrays. Bye, bearophile Please elaborate on this. How does one do that? With the new, delicious "

Re: Template classes

2009-04-15 Thread bearophile
Jarrett Billingsley: > Though actually I'm not sure why bearophile suggested this, The original poster seems to want to add some methods to a standard array. With this you can give another module something that acts like an array that also has such methods, or replaces them. With the old way you

Re: Template classes

2009-04-15 Thread Jarrett Billingsley
On Wed, Apr 15, 2009 at 12:13 PM, Arild Boes wrote: >> Take a look at the 'this' of D2, it allows to create wrapper structs, so >> you can just add methods to the built-in arrays. >> >> Bye, >> bearophile > > Please elaborate on this. How does one do that? With the new, delicious "alias this."

Re: Template classes

2009-04-15 Thread Arild Boes
bearophile skrev: Andrew Spott: yes, however there are going to be a few new classes that will be implemented in this (dot products, cross products, etc) You mean a few new methods. Take a look at the 'this' of D2, it allows to create wrapper structs, so you can just add methods to the buil

Re: Template classes

2009-04-14 Thread bearophile
Andrew Spott: > yes, however there are going to be a few new classes that will be implemented > in this (dot products, cross products, etc) You mean a few new methods. Take a look at the 'this' of D2, it allows to create wrapper structs, so you can just add methods to the built-in arrays. Bye,

Re: Template classes

2009-04-14 Thread Andrew Spott
yes, however there are going to be a few new classes that will be implemented in this (dot products, cross products, etc) Thanks for the help. -Andrew Steven Schveighoffer Wrote: > On Tue, 14 Apr 2009 17:33:29 -0400, Steven Schveighoffer > wrote: > > > e.g., the following code does almost

Re: Template classes

2009-04-14 Thread Steven Schveighoffer
On Tue, 14 Apr 2009 17:33:29 -0400, Steven Schveighoffer wrote: e.g., the following code does almost the same thing you are doing without requiring a new class: correction, the code does *exactly* the same thing you are doing. -Steve

Re: Template classes

2009-04-14 Thread Steven Schveighoffer
On Tue, 14 Apr 2009 17:01:28 -0400, Andrew Spott wrote: So, the attached is supposed to be a class that creates a vector of any type (I would like it to only take numerical values (int, float, real, double, etc), however, I am ok with it taking others (not that I see why someone would us

Re: Template classes

2009-04-14 Thread Denis Koroskin
On Wed, 15 Apr 2009 01:01:28 +0400, Andrew Spott wrote: So, the attached is supposed to be a class that creates a vector of any type (I would like it to only take numerical values (int, float, real, double, etc), however, I am ok with it taking others (not that I see why someone would use