[Issue 5547] Improve assert to give information on values given to it when it fails
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Feb 8 10:51:28 PST 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5547
Don <clugdbug at yahoo.com.au> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |clugdbug at yahoo.com.au
--- Comment #1 from Don <clugdbug at yahoo.com.au> 2011-02-08 10:49:00 PST ---
There's one difficult issue in this: this assert behaviour is not always
desirable, especially outside of unittests.
You have to save a copy of the parameters to assert, and that can be quite
expensive -- extremely expensive, in some cases.
And, you also need to be able to print them out, which creates the risk of
recursion, and potentially links in a huge amount of code.
The basic idea of making assert() be syntax sugar for an internal function
which behaves like your assertPred() does not seem too difficult. But knowing
*when* to do it is difficult.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list