How do List Functions Fail in Erlang?

Thank you for the super-detailed answer(s), @OvermindDL1 !!

I should’ve stated that I was testing this on OTP23, you’re right.

In any case, Lukas Larsson (from the OTP team) already replied in Medium with that regarding what they’re doing to improve error descriptions… and it’s GREAT!!

Finally, to some things in your message…

100% agree! I actually had to explain this very same thing when discussing the robot butt article on lobsters recently.

To be clear: Are we talking about the same different issues here? What I tried to say was that calling a function that works normally with empty lists, with an empty list and another wrong argument, should not behave as if it was called with something that’s not a list. Instead, it should behave as if it was called with a non-empty list. Do you still think that calling it with a bad fun and an empty list is a different issue than calling it with a bad fun and a non-empty list?

Of course, you’re right. But I was exemplifying.

Yeah, I agree again. That’s why the section in the article is called Is this a Problem? and not This is a Problem. This is clearly a made up problem just for the sake of arguing, except for the confusing error descriptions in the shell, which is what Lukas and the OTP Team are fixing right now :tada: :exclamation:

2 Likes