I am close to using a behaviour as a pure interface and I feel dirty...

Kostis Sagonas kostis@REDACTED
Thu Aug 26 09:45:29 CEST 2021


On 8/26/21 9:27 AM, Stanislav Ledenev wrote:
> And I would recommend spending more time with tools but be careful though.

Yes, both of these are good pieces of advice.  The second is also 
applicable to what one writes about the tools of the Erlang ecosystem.


> For example, due to dynamic nature of the language you write in your 
> code something
> like this:
>      foo() ->
>          Result = hjsdfkjsdhfskjfhskhskhfskl:yutyrutyriuyiw(),
>          ...
> 
> And it will compile. Because you can bring the module 
> "hjsdfkjsdhfskjfhskhskhfskl" later
> and the compiler doesn't know that. And the Dialyzer won't tell you 
> anything...
> But the "xref" tool may tell you that you are probably using an unknown 
> function in an unknown module.


Surely Dialyzer will tell you that there is an unknown function in the 
module that you analyze.

Other than speed, there is no reason to use 'xref' for this simple task.

Kostis


More information about the erlang-questions mailing list