<html><head></head><body>How does it mess with types? The andalso and orelse operators should only care about the type of the first operand and it always is boolean.<br>
<br>
I personally don't like list comprehension as brackets create additional noise and might not be obvious to other developers.<br>
<br>
Also dialyzer may complain about unused value in either of ways, so the cleanest is probably case or if. The latter in Elixir doesn't require else branch which reduces noise a little bit.<br><br><div class="gmail_quote">On 23 July 2018 21:05:37 GMT+10:00, Jesper Louis Andersen <jesper.louis.andersen@gmail.com> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">On Sun, Jul 22, 2018 at 9:09 PM Jachym Holecek <<a href="mailto:freza@circlewave.net">freza@circlewave.net</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"># Viktor Söderqvist 2018-07-22:<br>> <br>
>     Msg /= undefined andalso io:format("Message: ~s~n", [Msg]),<br>
> <br>
> I this good or bad style?<br>
<br>
It is horrible style. Pain to read, pain to modify, pain to reason about.<br>
<br>
Simple clear question deserves a simple clear answer. :-)<br>
<br></blockquote></div><div class="gmail_quote"><br></div><div class="gmail_quote"><div style="font-family:arial,helvetica,sans-serif" class="gmail_default">​I don't like the style either, mostly because it messes with the types. andalso and orelse expects boolean expressions, but the style used breaks that format. However, something like</div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default"><br></div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default">[x || Msg /= undefined]</div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default"><br></div><div style="font-family:arial,helvetica,sans-serif" class="gmail_default">doesn't.​</div><br clear="all"></div></div></blockquote></div><br>
-- <br>
Kind regards,<br>
Dmitry Belyaev</body></html>