On 19-Oct-09, at 7:47 AM, Richard Carlsson wrote:
> Yurii Rashkovskii wrote:
>> Currently erlc will spit a warning on this kind of constructs:
>>
>> {db, "localhost"}:connect()
>>
>> as opposed to
>>
>> DB = {db, "localhost"},
>> DB:connect()
>>
>> The warning will look like:
>>
>> Warning: invalid module and/or function name; this call will always
>> fail
>>
>> which is misleading, because this call will not fail (provided
>> modules
>> are in place and such)
>
> When you write code like the above, you are depending on how the
> current
> implementation of parameterized modules works. Don't do that.
I am pretty much aware of this mantra, thanks.
In fact, I seldom use parametrized modules per se, I am just utilizing
Erlang's capability to treat tuples as modules in another approach to
parametrized modules I built for myself.
Yurii.
________________________________________________________________
erlang-patches mailing list. See
http://www.erlang.org/faq.htmlerlang-patches (at) erlang.org