pos-int is confusingly named

Description

The generators neg-int and pos-int generate 0, which is confusing as (= (pos? 0} (neg? 0) false). The suggestion is to change s-pos-int and s-neg-int to pos-int and neg-int respectively, and replace the current neg-int and pos-int. Suggestions for new names include non-x-int and not-x-int.

Original issue

Environment

None

Activity

Show:

gfredericksMarch 6, 2018 at 2:30 AM

I think pos-int and neg-int should be deprecated (due to the confusing names), and probably not replaced. pos-int is just nat, and neg-int is a bizarre distribution that is easy enough to make yourself.

I'd like a somewhat rethought set of integer generators and am not confident what that would look like, but I do know for sure that it wouldn't involve these two, so deprecating them should be safe.

Ghadi ShaybanMarch 5, 2018 at 6:20 PM

users of this generator via clojure.spec never see the zeros

Details

Assignee

Reporter

Priority

Created March 4, 2014 at 2:22 PM
Updated March 6, 2018 at 2:30 AM