The issue with is_positive and is_negative is that they do not really solve
the problem. What if you want >= 0? Should we also add is_non_negative and
is_non_positive? Or what if you want x >= 2, which is what you would use if
you were implementing fibonacci?



*José Valimwww.plataformatec.com.br
<http://www.plataformatec.com.br/>Founder and Director of R&D*

On Wed, Nov 22, 2017 at 1:38 PM, Andrea Leopardi <[email protected]>
wrote:

> is_nil/1 is harder to justify for me and I get that it could be
> implemented as "== nil". As for is_odd/1 and is_even/1, have a look at they
> implementation. They are implemented in a faster but more obscure way than
> the simple "rem() == 0" or "rem() == 1".
>
>
> Andrea Leopardi
> [email protected]
>
> On Wed, Nov 22, 2017 at 4:22 PM, Isaac Whitfield <[email protected]> wrote:
>
>> I'm curious what you feel about is_odd/1, is_even/1 and is_nil/1?
>>
>> On Wednesday, November 22, 2017 at 7:20:35 AM UTC-8, Tallak Tveide wrote:
>>>
>>>
>>>
>>>> Sure, but saying "we'll never fix them all, so why even try?" is not a
>>>> good argument. Saying that the solution is unit tests is true for every
>>>> behaviour; moreover people who don't know this semantic wouldn't test for
>>>> it.
>>>>
>>>>
>>>>
>>> I'm arguing that I feel this direction is not what I would expect of
>>> Elixir, being a dynamically typed language. I would not trade "bloating the
>>> Kernel module" (sorry for not finding a nicer wording, I don't mean to be
>>> harsh) for this functionality.
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "elixir-lang-core" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/elixir-lang-core/09ce8113-eb6f-41cd-aa06-9885c79098e4%
>> 40googlegroups.com
>> <https://groups.google.com/d/msgid/elixir-lang-core/09ce8113-eb6f-41cd-aa06-9885c79098e4%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/elixir-lang-core/CAM9Rf%2BJmDDSS3pnMkiPOthE7p6JT%
> 3Dsq4Z__frjzQzH5KOpV8yw%40mail.gmail.com
> <https://groups.google.com/d/msgid/elixir-lang-core/CAM9Rf%2BJmDDSS3pnMkiPOthE7p6JT%3Dsq4Z__frjzQzH5KOpV8yw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4Jgory-aKS%2BpcbW%3D%2BS1MQf1Doqwc1ZK0DU5Y%3DErdpxoKg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to