Eliminate assert and lazy from D?

Kagamin spam at here.lot
Tue Oct 13 07:55:20 PDT 2009


Don Wrote:

> assert: should remain. It is important to the compiler. I can easily 
> imagine it participating in range checking.
> uint x = whatever();
> assert(x<100);
> ubyte b = x;  // This implicit conversion is OK; we know x is in the 
> appropriate range.

how about this?

long more=fileLength;
ubyte[256] buff;
for(; more>=buff.length ; more-=buff.length)
{
  //read from file, no breaks
}
//last read
read(file,buff.ptr,more);
auto rd=buff[0..more]; //can't cast long to uint



More information about the Digitalmars-d mailing list