<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000'>Yes, Erlang is definitely much closer to Lisp-2 than Lisp-1, especially as you can functions with the same name and different number of arguments (arity) and they are different functions. Don't stretch the analogy too far though. It is NOT that the functions are properties of the name (atom). To uniquely identify a function you need its module name, function name and arity, often written a M:F/A. Erlang doesn't have packages in the CL sense, there is only only one atom space containing all atoms.<br><br>Robert<br><br><hr id="zwchr"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Rustom Mody" <rustompmody@gmail.com><br><b>To: </b>"Thomas Allen" <thomas@oinksoft.com><br><b>Cc: </b>"Erlang Users' List" <erlang-questions@erlang.org><br><b>Sent: </b>Wednesday, 12 December, 2012 7:40:26 PM<br><b>Subject: </b>Re: [erlang-questions] noob namespace question<br><br><div class="gmail_quote">On Thu, Dec 13, 2012 at 12:00 AM, Thomas Allen <span dir="ltr"><<a href="mailto:thomas@oinksoft.com" target="_blank">thomas@oinksoft.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Wed, Dec 12, 2012 at 11:44:43PM +0530, Rustom Mody wrote:<br>
> I dont understand. Let me try and be more explicit about my concern.<br>
><br>
> Let h be a higher-order function of one argument (h/1)<br>
><br>
> Now in the call h(foo)<br>
> How does Erlang know whether foo is a function or an atom?<br>
<br>
</div>This is not valid, and you will get a "bad function" error if you try to<br>
pass your function this way. You must create a "fun" like so:<br>
<br>
h(fun foo/0)<br>
<br>
Similarly, you could pass an anonymous fun (like fun(X) -> X end), or<br>
a module-function combination (like fun lists:reverse/1).<br>
<span class="HOEnZb"></span><br></blockquote></div><br>Thanks Thomas that answers succinctly.<br>In Lisp terminology Erlang is more like a Lisp-2 than a Lisp-1<br><br><a href="http://en.wikipedia.org/wiki/Common_Lisp#The_function_namespace" target="_blank">http://en.wikipedia.org/wiki/Common_Lisp#The_function_namespace</a><br>
<br>-- <br><a href="http://www.the-magus.in" target="_blank">http://www.the-magus.in</a><br><a href="http://blog.languager.org" target="_blank">http://blog.languager.org</a><br><br><br>
<br>_______________________________________________<br>erlang-questions mailing list<br>erlang-questions@erlang.org<br>http://erlang.org/mailman/listinfo/erlang-questions<br></blockquote><br></div></body></html>