DMD 0.165 release

Tom S h3r3tic at remove.mat.uni.torun.pl
Sun Aug 20 22:56:06 PDT 2006


Walter Bright wrote:
> I was going to call this 1.0 RC1, but I just could not resist adding the 
> lazy expression evaluation. This adds one of the big capabilities of 
> common lisp.
> 
> http://www.digitalmars.com/d/changelog.html

Simply WOW !
I can't wait to use the feature. Btw, I think there is a bug in the 
Enforce example... IMO It should look more like in this test case:



import std.stdio;


class Spam {
	void ham() {
		writefln("ham() called !");
	}
}


T Enforce(T)(T delegate() p, char[] msg)
{
	writefln("entering Enforce()");
	auto res = p();
     if (!res)
	throw new Exception(msg);
     return res;
}


Spam foo(int a, int b) {
	writefln("entering foo()");
	if (a == b) return new Spam;
	else return null;
}


void main() {
	Enforce(foo(1, 1), "omigosh !").ham();
	Enforce(foo(1, 2), "omigosh !").ham();
}


--
Tomasz Stachowiak  /+ a.k.a. h3r3tic +/



More information about the Digitalmars-d-announce mailing list