From 076585e1ce77cb5e63a832b3f7966d08c2f9eddf Mon Sep 17 00:00:00 2001 From: Julius Putra Tanu Setiaji Date: Fri, 22 Feb 2019 17:39:21 +0800 Subject: [PATCH] Change to more idiomatic elixir conditional syntax --- markup/logic | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/markup/logic b/markup/logic index 329eef3..bac4927 100644 --- a/markup/logic +++ b/markup/logic @@ -111,8 +111,11 @@ foo(X, Y) = foo(1, 2).||{X, Y} = {1, 2}. _ @<  >@X > 0 -> 1; _ @<  >@X == 0 -> X; _ @<  >@X < 0 -> -1 _ -end|| if x > 0 do 1 else if x < 0 do -1 else 0 end end|| -||[#case case]||(@<  >@X = 1 -> Result = true _ +end||cond _ +@<  >@x > 0 -> 1 +@<  >@x == 0 -> x +@<  >@x < 0 -> -1 +end||[#case case]||(@<  >@X = 1 -> Result = true _ ;@<  >@X = 0 -> Result = false ). _ ##gray|//or://## _ member(X-Result, [ _ @@ -865,4 +868,4 @@ The expressions in guards must be side-effect free. Thus they can only contain + [#top Elixir] [http://elixir-lang.org/getting-started/introduction.html Elixir: Introduction] -[http://elixir-lang.org/docs/stable/elixir/Kernel.html Elixir: Standard Library] \ No newline at end of file +[http://elixir-lang.org/docs/stable/elixir/Kernel.html Elixir: Standard Library]