An Unprecedented Subtraction

1 · Brujo Benavides · July 2, 2019, 11:23 a.m.
Let’s go back to the origins of this blog with a bit of unexpected code behavior. This time, let’s try removing elements from a list…Maxwell Smart — because I couldn’t find any proper image for this articleLet’s Subtract!The beauty of this trick is that the code examples work in both Erlang and Elixir, with barely any changes at all… I’ll do it in Elixir, feel free to try them out in Erlang or efene if you like.Now, this is a list…iex(1)> [1, 2, 3][1, 2, 3]And now, we can subtract a few elements...