Why Erlang tuple module is controversial?

后端 未结 2 456
别那么骄傲
别那么骄傲 2021-01-12 09:19

A similar question was asked Parameterised Modules in Erlang, it is about \"what\". My question is about \"why\"?

OTP Technical Board - Decisions affecting R16 conta

2条回答
  •  青春惊慌失措
    2021-01-12 10:03

    There are other issues as well:

    • When I write Foo:bar(42) where Foo maybe either just a module name or maybe a tuple module but I don't see the difference. This means I might be calling either bar/1 or bar/2.

    • I can call the same function in different ways.

    • It can be difficult to relate errors in functions to the call as the arity is different.

    And more. I think it is a shame that we didn't get rid of tuple modules when we got rid of parametrised modules. They were originally just a hacky way of implementing parametrised modules.

提交回复
热议问题