vendredi 23 septembre 2016

Erlang help: Using an If Statement in an anonymous function

So I installed the Erlang plugin for IntelliJ and I'm running into a roadblock. I have an anonymous function and I inserted an if statement into it. That should work, but it doesn't.

Max_Fun = fun(X, Max) -> if
                          X > Max -> X;
                          X <= Max -> Max
                         end

See my issue is that the less than or equal to comparison has a red squiggly underline. When I hover over it I am told " '<=' unexpected " Why is this happening and how can I fix it?

Aucun commentaire:

Enregistrer un commentaire