<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EstiloCorreo17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=ES link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US>Hi all,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>I was dealing with edoc and -spec attribute and I found a little not liked behavior regards importing types from another modules.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>For examples I was setting the specification of start/2 application start point function like this:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>%%%---------------------------------------------------------------------<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>%%% @doc<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>%%% Start point of the application.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>%%% @end<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>%%%---------------------------------------------------------------------<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>-spec start(StartType, StartArgs) -> {'ok', Pid} | {'ok', Pid, State} when<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> StartType :: application:start_type(), %% @see application module for start_type() type specification.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> StartArgs :: term(),<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> Pid :: pid(),<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> State :: term().<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>start(StartType, StartArgs)-><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> . . .<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>I check the source of application module to see if the start_type() type was exported and it is not.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>And my module compiles well, and even I changed to StartType :: unknown_module: unknown_type() type and it still compiles,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>It seems that there are no type checking outside of the module.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>All this could seems a little nothing important thing but, I like to program in Erlang a lot, even without using any IDE, I like notepad++ with Erlang colors definition.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>And I’m proud of my code and the language even more since I learned that I can do thing like -spec, -type and documentation.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>The same still happens with functions, I can do non_declared_module:non_declared_fun() and it will compile. Only in runtime it will fail.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Cheers,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>Ivan.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>NOTE: I apologies for any bad intention you could think I have with this, I stand for Erlang and its Community.<o:p></o:p></span></p></div></body></html>