Closed RickHPotter closed 3 months ago
I just realised that the delete_any
external function is also with the wrong order. It should be key, Tree1
, but the exercise says otherwise.
I believe the order isn't the same as the Erlang version on purpose: having the tree as the first parameter is better for piping in Gleam, and the hints remind users that a private function can be used to change the order of parameters. Since you created the issue, #514 was also merged, which adds a reminder that the correct order of arguments should be used.
That's right 👍 In Gleam the data structure goes first always.
https://exercism.org/tracks/gleam/exercises/erlang-extraction
In the exercise, it says
But the correct order is as follows
insert(Key, Value, Tree1) Inserts Key with value Value into Tree1 and returns the new tree. Assumes that the key is not present in the tree, crashes otherwise.