Re: Generalisation of pre-conditions

2015-02-19 Thread Cecil Westerhof
2015-02-19 15:11 GMT+01:00 Justin Smith : > People complain about stack traces, but precisely the point of having > stack traces is that if a pre-condition fails, you don't look at the > function with the pre-condition, you look at the function that was calling > it. Duplicating pre-conditions to

Re: Generalisation of pre-conditions

2015-02-19 Thread Justin Smith
People complain about stack traces, but precisely the point of having stack traces is that if a pre-condition fails, you don't look at the function with the pre-condition, you look at the function that was calling it. Duplicating pre-conditions to callers, as a general pattern, would scale very

Generalisation of pre-conditions

2015-02-19 Thread Cecil Westerhof
I have two different functions for the same functionality. I would like to share the pre-conditions between them. The general function is: (defn test-lucky-numbers-general "Performance test of lucky numbers general" [fn desc nr] {:pre [(>= nr 1) (<= nr 7)]}