[erlang-questions] Misultin EOL

Bob Ippolito <>
Sat Feb 18 18:15:34 CET 2012


On Sat, Feb 18, 2012 at 8:58 AM, Joe Armstrong <> wrote:

> On Sat, Feb 18, 2012 at 5:16 PM, Jesse Gumm <> wrote:
> > Well that is good news to hear that param modules are here to say.
>
> Well actually it's the abuse of PMs that will stay.
>
> That {Mod,a,b,c}:foo(x,y) means foo(x,y,{Mod,a,b,c})
> is an accidental side effect of the way parameterised modules
> were implemented.
>
> The "official way of creating a PM" is with Mod:new(...)
> and NOT PM = {Mod,a,b,c}. Somebody (I don't know who)
> discovered how to build a PM *without* calling Mod:new.
>
> I discovered this when reading the misultin code since this
> has never been documented. I fell mentally off my chair - I had no
> idea this was possible. I think (I speculate here) that
> misultin got the idea from mochiweb, but how mochiweb got the idea I know
> not.
>
> It's actually a very nice mechanism - the MFA and fun alternatives are
> a few characters more and less pretty
> so it will stay.


I think that the paper introducing PMs mentioned it, but it's hard not to
see what the representation of a PM looks like at the prompt.

-bob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20120218/1c059faa/attachment.html>


More information about the erlang-questions mailing list