Do you say 'unpack' or 'destructure'?

Consider this Erlang code:

Rectangle = {rectangle, 20, 10}.
{rectangle, Width, Height} = Rectangle.
> Width.
20
> Height.
10

When I was watching an Elixir video the person kept calling this ‘destructuring’ (which I think is what they say in the JS world?) but Joe Armstrong, in his book Programming Erlang, calls this ‘unpacking’ - so I am curious, how do you refer to it when using a BEAM language?

  • Unpack
  • Destructure
  • Use the terms interchangeably depending on the language
  • Something else - please say in thread!

0 voters