assert(condition[, message]) patch

Thomas Kuehne thomas-dloop at kuehne.cn
Thu Jun 1 13:17:31 PDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

pragma schrieb am 2006-06-01:
> To sum up: I honestly feel that the two capabilities, assert() and writefln(),
> should be merged into an extended assert() statment, for the sake of encouraging
> better coding and library use.

That's easy:

# import std.stdio;
# import std.stdarg;
# 
# bool assertln(...){
#   writefx(stdout, _arguments, _argptr, 1);
#   return false;
# }
#

# 
#   // ...
#   assert(a == b || assertln("%s != %s", a, b));
#   // ...
# 

Thomas


-----BEGIN PGP SIGNATURE-----

iD8DBQFEf1ix3w+/yD4P9tIRAjo6AJ9jH5cEKVNBjPCDAfi/MO14xqSumACfQMem
fhE84xqWoqTYtOg895pDA58=
=0sAG
-----END PGP SIGNATURE-----



More information about the Digitalmars-d mailing list