[erlang-questions] Trouble with Erlang's lenient comparisons

Ahmed Omar spawn.think@REDACTED
Wed Apr 13 11:17:09 CEST 2011


Using Typer and Dialyzer is usually what you u need
http://www.erlang.org/doc/reference_manual/typespec.html#id72693


On Wed, Apr 13, 2011 at 11:08 AM, JohnyTex <ekeroth.christoffer@REDACTED>wrote:

> Hello! :)
> I'm a newbie Erlang programmer, and I've really liked my experience so
> far. However, I've made mistakes related to Erlang's type system a
> couple of times now, more specifically the fact that you can compare
> different types with each other without Erlang complaining.
>
> I've inherited someone else's code base; sometimes I forget that a
> function returns a tuple and I up comparing it with an integer or
> similar, and get weird behaviour and hard-to-find bugs as a result.
>
> What's the best way to prevent this? I will try writing some unit
> tests later today with EUnit, and I'm generating PLTs for Dialyzer as
> I write this, but I was wondering if there are any other tools or
> "best practices" that could help me to write more "type safe" code?
>
> Thanks in advance! :)
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>



-- 
Best Regards,
- Ahmed Omar
http://nl.linkedin.com/in/adiaa
Follow me on twitter
@spawn_think <http://twitter.com/#!/spawn_think>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110413/88dd4683/attachment.htm>


More information about the erlang-questions mailing list