reiddraper / simple-check

QuickCheck for Clojure
http://reiddraper.github.io/simple-check/
286 stars 18 forks source link

pos-int is confusingly named #46

Closed gfredericks closed 10 years ago

gfredericks commented 10 years ago

I was about to complain about pos-int generating 0's when I noticed s-pos-int.

Am I crazy for thinking pos-int is totally misleading?

cemerick commented 10 years ago

I agree entirely FWIW.

Hopefully it's not too OT, but in the same vein of API intutions: it seems that int should yield ints (or at least, longs in the range of int. Not a big deal to have an int32 generator around, but…

hypirion commented 10 years ago

Agreed on the confusing naming scheme, hurt me before I read this issue.

I would guess better names here could be not-neg-int and not-pos-int?

gfredericks commented 10 years ago

My vote is for non-neg-int, which I think is in line with normal mathematical usage. not-neg-int has the downside of sounding like it might specify (not (and (integer? x) (neg? x))), i.e. that any non-integer type would be valid.

Not that there's much danger of anybody thinking that's the most plausible interpretation.

reiddraper commented 10 years ago

Agree too. I think I'd like to tackle this soon after the Clojure contrib migration.

reiddraper commented 10 years ago

Moved to Jira.