[erlang-questions] Inline If
Sun May 9 00:37:54 CEST 2010
so the answer would be
-define(ASSERT(TEST,TRUE,FALSE), case TEST of true -> TRUE; false ->
This seems to imply that even just wanting to use such construct is not
a common thing in Erlang.
Is there a reason for that in the nature of FP or Erlang?
Zoltan Lajos Kis wrote:
> On 5/9/2010 12:00 AM, Henning Diedrich wrote:
>> Is there a common Erlang way to do stuff like C++:
>> a ? b : c;
>> The list comprehension
>> [X || X <- [B,C], A ]
> You can define a function or macro for this purpose; see "assert"
> discussed in this thread: Ternary operator used as assert
More information about the erlang-questions