[Jprogramming] constraint idioms

Miller, Raul D rdmiller at usatoday.com
Wed Apr 19 23:18:38 HKT 2006


Roger Hui wrote:
> Asserts have advantages over your proposed technique:
> - It's clearer what asserts are doing.
> - It's possible to turn asserts on and off (9!:34 and 9!:35).
> On the other hand, asserts require the use of
> explicit definition.  Both techniques are better than 

I suspect you've forgotten about the assert monad:

   assert
0 0"_ $ 13!:8^:((0: e. ])`(12"_))
   assert 1
   assert 0
|assertion failure: assert
|       assert 0
   9!:34''
1
   9!:35]1
   assert 0
|assertion failure: assert
|       assert 0

-- 
Raul



More information about the Programming mailing list