Even and Odd Integers

I read Steve's comment as more in favour of isDivisible instead of isEven / isOdd.

In the proposal, I'll modify the Alternatives title to Alternatives & Possible Additions :slight_smile:

You're right, the discoverability argument in my previous post isn't very strong. I originally had a blurb about the naming of the function - I think it would likely end up being divisible(by:) - but I didn't want to get too sidetracked. I think discoverability is mostly equivalent if the is prefix is there but I don't believe there are many examples of Boolean functions in the standard library or foundation that are prefixed like that. Even if the prefix is dropped, discoverability is only impacted slightly, though.

I think this is a pretty important point and has been brought up in the discussion of 'Double modulo' operator. I would personally be more inclined to introduce properly named functions for remainder and mod/modulo and discourage the use of % with linter rules in my own projects, rather than adding divisible(by:) in an attempt to mitigate some of the issues with %. I could still see there being good reasons for including divisible, it'd just need to be pitched and evaluated more thoroughly, in my opinion.

1 Like