[erlang-questions] Construct parameter dynamically, sometimes illegal?

mog <>
Fri Jul 11 16:40:44 CEST 2008


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

Caspar Florian Ebeling wrote:
| I'm really a bit confused about cases when it is not possible to
| pass parameters which were created dynamically. An example:
| this does not work,
|
|     {ok, File} = file:open("writebench.data.erl",
|                [write, binary, raw, {delayed_write, math:pow(2, 12), 
1000}]
math:pow(Int) -> Float, so that will be the wrong type for that 
function, if you have a function that returns an int I am sure it will 
work, or if you surround it in a round or trunc it will work fine.

Mog
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkh3cOUACgkQeq+tARrxhnuPGgCgnxkhOwGC58N3qv6i2ClAztf2
x+gAoJ/IbPoWlsQ1yt0Y3O5yMKVL6Jd7
=nq+2
-----END PGP SIGNATURE-----




More information about the erlang-questions mailing list