Re: is there a way to report an argument number in spec?

2016-06-23 Thread Elena Machkasova
Never mind, we have figured it out: using s/* gives us the argument number in the "in" part of "explain". Elena On Thursday, June 23, 2016 at 10:41:27 AM UTC-5, Elena Machkasova wrote: > > I am trying to use a combination of fdef and instrument in spec, and I was

Re: clojure.string unexpected behaviors

2016-06-23 Thread Elena Machkasova
I wasn't saying that the functions implementation is incorrect (it does follow the specification). However, I think 'capitalize' obscures the error in the case when it would've been easy to fail early and produce meaningful error reporting (as 'reverse' does). Adding spec conditions would help,

is there a way to report an argument number in spec?

2016-06-23 Thread Elena Machkasova
I am trying to use a combination of fdef and instrument in spec, and I was wondering if there is a way to apply a condition to each of the :args and be able to report the argument number on which the precondition fails. For instance, we require all args (in a function with a variable number of

clojure.string unexpected behaviors

2016-06-21 Thread Elena Machkasova
Greetings, I was looking at clojure.string functions, and noticed that some have unexpected (especially for less experienced programmers) behavior on non-string arguments. For instance, 'capitalize' applies toString to its argument, effectively making it possible to pass any type, but with une