Re: A more useful assert macro

2008-12-19 Thread jdz
On Dec 19, 4:27 pm, Stuart Halloway wrote: > While we are talking about assert: I recently wanted for assert to   > return the value of the expression, so I could embed asserts inside a   > Fact test and get detailed reporting about what failed. > > I checked a few other functional languages and

Re: A more useful assert macro

2008-12-19 Thread Stuart Halloway
While we are talking about assert: I recently wanted for assert to return the value of the expression, so I could embed asserts inside a Fact test and get detailed reporting about what failed. I checked a few other functional languages and none of their asserts return a value either. This s

A more useful assert macro

2008-12-19 Thread jdz
At the moment assert macro accepts only a single argument - a test. If the test fails (is false), an exception is thrown. But the only information available (until we have better introspection tools) is the test _expression_. This causes problems when working on many items that should satisfy an a