[racket] Testing "impossible" branches in the code

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Tue Apr 15 16:49:43 EDT 2014

On Apr 15, 2014, at 4:02 PM, Mikko Tiihonen <mikko.tiihonen at tmtiihonen.fi> wrote:

> as I dissected the code it became clear to me that my implementation had been far from clean. One of the problems was that the responsibility for checking return values was not in the function returning the value, but in the calling function.
> 
> The main thing seems to be that I need to check return values for type and also for range. After some refactorings I have transferred the responsibility for checking these values so that testing became easier. Also, It starts to look like typed Racket would be an appropriate solution for making the code more robust.


It sounds like you are reinventing contracts. Are they powerful enough to give you what you want? 

Posted on the users mailing list.