is there "return" in Erlang.

Wang Wei wgwi@REDACTED
Mon Feb 28 04:14:31 CET 2011


Hello, I has a question about how to convert the bellow C program into Erlang.

void judge()
{
    int a;
    int b;

    a = getA();
    if (a == CONF1)
   {
       doSomeThing(a);
       return;
   }

   b = getB();
   if (b == CONF2)
   {
       doOtherThing(b);
        return;
   }

   doThings();
   return;
}

I think about "case" and "if" construct, but none of it seems work fine, thanks for help.


More information about the erlang-questions mailing list