Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

No, at least in Erlang a variable is assigned once, you can then match against that variable as it can't be reassigned:

    NotFound = 404,
    case Status of
        NotFound -> "Not Found";
        _ -> "Other Status"
    end.
That snippet will return "Other Status" for Status = 400. The Python equivalent of that snippet is a SyntaxError as the first case is a catch all and the rest is unreachable.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: