[erlang-questions] binary optimization

Thomas Lindgren <>
Mon Jul 20 23:25:29 CEST 2009






----- Original Message ----
> From: Joel Reymont <>
>
> On Jul 20, 2009, at 5:25 PM, Thomas Lindgren wrote:
> 
> > I'm not sure this was answered, but: ?MODULE macroexpands to the current 
> module, so the example would be a remote call foo:loop(...), not an apply.
> 
> 
> I thought a remote call was rpc:call. What am I missing?

Sorry, it's a bit of jargon again. mod:func(X1,...,Xn), sometimes known as a fully qualified call: you know the module and function invoked, though the precise call target depends on the currently loaded module. (Local calls by contrast are inside the current module, "do not check for code change", etc.)

> If foo:loop is not an apply then why does the compiler complain about it?

Higher-order calls include M:F(...), F(...), M:f(...) and so on, where the call target is for some reason dynamic. If there is no higher-order call there, I'm stumped. What does the beam code look like?

Best,
Thomas


      



More information about the erlang-questions mailing list