Let Go, Standard Library From Community
Sean Kelly
sean at f4.ca
Wed Apr 18 13:13:17 PDT 2007
Dan wrote:
>
> I went through tango.core.Array and tango.math.Math and personally found several rather junior mistakes like:
>
> int abs(int x){
> return x > 0? x : -x;
> // should be: return x &= 0x7FFF_FFFF;
> }
>
> and all sorts of template mess in Array and String just to implement things like find as well as several equivalents to opAssign, opAdd, opCat etc.
>
> I spent three minutes quickly trying out a template that could implement find on an array of any type using delegates or functions, as well as trying to remember what an operator overload would be classified as; and to be honest I did find it somewhat disorienting so I can understand that part.
You're welcome to submit suggestions if you think the current
implementation can be improved. Please note that any array routine must
work for array literals, static arrays, and dynamic arrays, that
duplicate generated code should be avoided whenever possible, and any
default predicate should have its code inlined. Also, predicate support
must allow for any callable type, not just delegates and functions.
Sean
More information about the Digitalmars-d
mailing list