Hey guys,

I am still not convinced. Elixir is not a statically typed language. The 
> guard you mention does add some checking, and I wouldnt mind seeing it in 
> Elixir code, but there are so many of these kinds of bugs that still remain 
> ‘unsolved’. The tool to deal with these kinds of bugs are unit tests and 
> dialyzer.


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 not convinced by this idea as well. Why should we have special 
> treatment for lesser/greater than zero, but not for an arbitrary number?
>

That's a fair point, I just feel that is_positive/1 and is_negative/1 will 
be used in enough places that make it the common choice. I wish my GitHub 
search skills were up to scratch for this :) 

What if I want to allow float AND integer, with the proposed guards it is 
> not possible. 
>

The proposed guards do make that possible; the ones imported from Kernel 
would allow both float and integer.

On Wednesday, November 22, 2017 at 12:54:25 AM UTC-8, Norbert Melzer wrote:
>
> I'm not convinced by this idea as well. Why should we have special 
> treatment for lesser/greater than zero, but not for an arbitrary number? 
> What if I want to allow float AND integer, with the proposed guards it is 
> not possible. 
>
> Tallak Tveide <[email protected] <javascript:>> schrieb am Mi., 22. Nov. 
> 2017 um 07:20 Uhr:
>
>> I am still not convinced. Elixir is not a statically typed language. The 
>> guard you mention does add some checking, and I wouldnt mind seeing it in 
>> Elixir code, but there are so many of these kinds of bugs that still remain 
>> ‘unsolved’. The tool to deal with these kinds of bugs are unit tests and 
>> dialyzer.
>>
>> --
>> 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] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/elixir-lang-core/e7227105-994d-4416-b829-17466b11da00%40googlegroups.com
>> .
>> 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/6cf2af2d-5466-4814-a9a7-b016db38295d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to