list comprehension abuse

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

list comprehension abuse

Frans Schneider-2
Dear list,

Just stumbled over some code using the following construct:

   [do_something(X) || X /= 1, X /= 3]

Works rather nice, but is this considered good programming? I think it
is called "list comprehension with no generator" and has to do something
with OTP-7846.

Frans
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: list comprehension abuse

Brujo Benavides-3
I wrote a blog post about this a while back: https://medium.com/erlang-battleground/list-incomprehensions-ec504ec927c5
Cheers! :)

On 13 Jun 2018, at 14:08, Frans Schneider <[hidden email]> wrote:

Dear list,

Just stumbled over some code using the following construct:

 [do_something(X) || X /= 1, X /= 3]

Works rather nice, but is this considered good programming? I think it is called "list comprehension with no generator" and has to do something with OTP-7846.

Frans
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions