[erlang-questions] Orelse and andalso as short-hand for case

Viktor Söderqvist viktor@REDACTED
Sun Jul 22 14:25:00 CEST 2018


Hey everyone,

I've seen these short-circuit operators with a non-boolean second
operand, usually where the second operand is doing some side-effect and
the return value is not important. It seems to be a trend. Example:

    Msg /= undefined andalso io:format("Message: ~s~n", [Msg]),

I this good or bad style?



More information about the erlang-questions mailing list