DMD1 function template broken or did I f.u.?

2010-08-24 Thread 0ffh


Hi, all!

Try this:

--- snip ---

void remove(T)(out T[] array,T element) {
  int r=0,w=0;
  while (rarray.length) {
if (array[r]!=element)
  array[w++]=array[r];
++r;
  }
  array.length=w;
}

void test() {
  int[] array;
  int element=2;
  //
  array=[1,3,2,2,1,3,1,1,2];
  writef(direct\n);
  writef(  before : ,array,\n);
  int r=0,w=0;
  while (rarray.length) {
if (array[r]!=element)
  array[w++]=array[r];
++r;
  }
  array.length=w;
  writef(  after  : ,array,\n);
  //
  array=[1,3,2,2,1,3,1,1,2];
  writef(template\n);
  writef(  before : ,array,\n);
  remove!(int)(array,element);
  writef(  after  : ,array,\n);
}

--- snap ---

I get the following output:

direct
  before : [1,3,2,2,1,3,1,1,2]
  after  : [1,3,1,3,1,1]
template
  before : [1,3,2,2,1,3,1,1,2]
  after  : []

So, my question is: Huh?

Kind regards.





Re: dmd 1.042 and 2.027 releases

2009-04-01 Thread 0ffh

bearophile wrote:

I have tried on Windows, on a 2-core CPU and the CPU usage is about 50%
still (only one core used).


Well, I that's a pure reader thread running in the bg it wouldn't take any
cpu time. That's because it's basically just waiting for data transfers from 
the disk to put them in a queue for the compiler thread.


Re: dmd 1.041 and 2.026 releases

2009-03-07 Thread 0ffh

Walter Bright wrote:

[...] Back in college, a science historian did a nice lecture on how
research was done. He said that in reading the scientists' notebooks, he
found that they went all over the place in trying to find a solution. When
they finally found it, they wrote a paper where they presented their 
activities as a straight line progression from hypothesis to proof, whereas

the reality of how it actually happened was nothing like that. [...]


Reminds me of Parnas' A rational design process: How and why to fake it... =)


Re: dmd 1.041 and 2.026 releases

2009-03-05 Thread 0ffh

Walter Bright wrote:

[...]
Essentially, it's pretty obvious that the world has changed, and closed 
source is no longer acceptable for a mainstream product that people will 
be relying on. Open source is the future, and it's past time for dmd to 
join the party!


Hell, I'm at a loss for words! Go, D!


Re: Just one more thing...

2009-02-23 Thread 0ffh

Walter Bright wrote:

Anders Bergh wrote:

Just downloaded it and I can confirm that it does run on 10.4:
[evidence]

Woo-hoo!


Congrats! =)


Re: D hits Slashdot

2009-02-22 Thread 0ffh

Daniel de Kok wrote:

http://tech.slashdot.org/article.pl?sid=09/02/22/1346256

:)


I wonder if /that/ will do something to the TPCI... :)