Return statement in Elixir

后端 未结 8 1425
野趣味
野趣味 2020-12-14 00:38

I need a function with some kind of a step-by-step logic and I wonder how I can make one. Let\'s take a log in process on a site as an example, so I need the following logic

8条回答
  •  一向
    一向 (楼主)
    2020-12-14 01:13

    You don't need any return statement, as the last value returned by a control flow operation (case/conf/if…) is the function's return value. Check this part of the tutorial. I think cond do is the operator you need in this case.

提交回复
热议问题