[erlang-questions] what is the correct syntax to spawm a MFA with no arguments?

mog <>
Wed Apr 30 20:11:01 CEST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jarrod Roberson wrote:
> start() -> spawn(fun loop/0).
>
> I want to convert the above code snippet into a MFA, what is the
> correct syntax to do this.
>
> I tried start() -> spawn(?MODULE, fun loop/0, []). and all I get
> when I call it is ** exception error: bad function 'area_server.start'

why arent you doing spawn(fun loop() end) or spawn(mod, loop, []) ?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIGLY0eq+tARrxhnsRAjXkAJ9Kac0rnJmyvGMj5aBEFg1KDMnqYgCfbETU
CnQVOwMecrPNKI+7gV9hH+8=
=PNFc
-----END PGP SIGNATURE-----




More information about the erlang-questions mailing list