By implication - what I will write has been said. <div><div>But I will just spend a second reinforcing this and dispelling any misconceptions.</div><div><br></div><div>They can - if you force it into an atom. </div><div><br>
</div><div><div>-module(capsFuncs).</div><div>-export(['Run'/1]).</div><div>'Run'(this) -></div><div> that.</div></div><div><br></div><div><br></div><div><div>1> c(capsFuncs).</div><div>{ok,capsFuncs}</div>
<div>2> capsFuncs:'Run'(this).</div><div>that</div></div><div><br></div><div><br><div><br><div class="gmail_quote">On Thu, Dec 13, 2012 at 1:37 AM, Richard O'Keefe <span dir="ltr"><<a href="mailto:ok@cs.otago.ac.nz" target="_blank">ok@cs.otago.ac.nz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
On 13/12/2012, at 7:14 AM, 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>
For one thing, function names in Erlang are *NOT* atoms.<br>
They are *PAIRS* <atom>/<arity>. So if you just see an<br>
atom, it cannot possibly be a function (or the name of a<br>
function) because there simply is not enough information<br>
there.<br>
<br>
Actually, I told a lie. Function names are<br>
module:name/arity triples. If you are referring to a<br>
function in the same module, you can omit the module:<br>
prefix.<br>
<br>
If you wanted to call h passing it a reference to a local<br>
function named foo with 3 arguments, you would have to write<br>
h(fun foo/3).<br>
<br>
In Common Lisp,<br>
(h 'foo) the atom FOO<br>
(h foo) value of the variable FOO<br>
(h #'foo) the function FOO<br>
<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</div></div></blockquote></div><br></div></div></div>