www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - shortening an example in the docs

reply Karen Lanrap <karen digitaldaemon.com> writes:
In the lazy evaluation page it says:

bool scase(bool b, lazy void dg)
{
    if (b)
    {	dg();
	return true;
    }
    return false;
}


That is somehow unnecessary doubled precision. The following code
should do the same: 

bool scase(bool b, lazy void dg)
{
    if (b) dg();
    return b;
}
Oct 03 2006
parent Walter Bright <newshound digitalmars.com> writes:
You're right.
Oct 04 2006