[erlang-questions] question about Variable:fun()

Andy W. Song wsongcn@REDACTED
Mon Jun 27 07:28:58 CEST 2011


In my case the variable is a record like V = {rec, field1, field2} where rec
is indeed a module name with fun() defined in it. So it seems that calling
to this record will in turn call the first element?

Thanks
Andy


On Mon, Jun 27, 2011 at 12:35 PM, Jack Moffitt <jack@REDACTED> wrote:

> > New to Erlang. I saw some program with statement such as V:fun() which I
> > can't find from Joe's Erlang book. I know module:fun() is calling a
> function
> > defined in a module. But do this to a variable is confusing. Does that
> > variable define a function, and how?
>
> It is probably bound to an atom, like in this example:
>
> X = dict,
> D = X:new().
>
> jack.
>



-- 
---------------------------------------------------------------
有志者,事竟成,破釜沉舟,百二秦关终属楚
苦心人,天不负,卧薪尝胆,三千越甲可吞吴
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110627/c9e496c2/attachment.htm>


More information about the erlang-questions mailing list