<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 24/05/2011, at 6:39 PM, Dmitrii Dimandt wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><blockquote type="cite"><br></blockquote><blockquote type="cite">So I imagine:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">    1) all functions have unique names<br></blockquote><blockquote type="cite">    2) there are no modules<br></blockquote><blockquote type="cite">    3) we discover the name of a function by searching metadata<br></blockquote><blockquote type="cite">       describing the function in a database<br></blockquote><blockquote type="cite">    4) all public functions (think open source) are in the same<br></blockquote><blockquote type="cite">       database<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">We could make a system to do this.<br></blockquote><br>Hm... you'd still need *some* kind of modules.<br><br>For instance, in Webmachine each resource is expected to have some, or all, of predefined public/exported functions: to_html, resource_exists, allowed_methods etc.<br><br>So, each resource will have functions with the same name. If we move all functions to a global namespace, then how do we differentiate between these functions? Probably by naming them resource_name_function_name?<br><br></div></blockquote><div><br></div></div>In a normal language this would be a problem, but in erlang we can get the desired behaviour by using pattern matching, right?<div><br></div><div>So instead of</div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><br></div><div>to_html()</div><div>resource_exists()</div><div>etc</div></blockquote><div><br></div><div>We have</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">     </span>resource(to_html, ...)</div><div><span class="Apple-tab-span" style="white-space: pre; ">    </span>resource(exists, ...)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>etc</div><div><br></div><div>I'm not disagreeing with you - we do need some good way to do this. But I don't think modules are necessary in this case.</div><div><br></div><div>Josh. </div></body></html>