Practical use of improper lists in Erlang (perhaps all functional languages)

后端 未结 4 1607
时光取名叫无心
时光取名叫无心 2020-12-14 23:16

I\'ve been reading Erlang and OTP in action, and stumbled upon a question with regards to improper lists.

Don’t be tempted to use list cel

4条回答
  •  感情败类
    2020-12-14 23:36

    OTP stdlib dictionary implementation dict module is using improper lists for key-value pairs. The justification is 2-tuple uses 1 word more memory than 2-element improper list. See efficiency guide for details

提交回复
热议问题