Let Go, Standard Library From Community

Dan murpsoft at hotmail.com
Wed Apr 18 12:09:12 PDT 2007


Dan Wrote:
> On that note, I think I'll examine the Tango sources.  Whomever is working on Tangobos is definitely doing us all a favor.

Oh my...

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.

I wonder if Phobos is likewise written...



More information about the Digitalmars-d mailing list