문제

In Erlang, what is the difference between Expressions and Statements?

도움이 되었습니까?

해결책

In Erlang, everything has a value.

So, the difference is that Erlang has expressions but does not have statements.

That explains Erlang's (arguably) wacky "if" expression.

Since it, and everything else, must evaluate to some kind of value, people often end them with a "true -> ok" clause to ensure the if doesn't crash at runtime.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top