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

> multiple returns, closures, etc

What other new(ish) language in this day and age does not support this? You have closures in e.g. Haskell, Java, C#, Rust, C++, JavaScript, Python and Ruby. You have destructuring/unpacking support for tuples/lists or something similar that can be used for multiple return values in e.g. Haskell, Rust, Python and Ruby. I think there will be destructuring in future JavaScript standards and I don't know about C#. I think a new language that doesn't support these things would be disappointing.



C# can pass parameters by reference, which is often used to return multiple values from a function. In new C# 6 it will look like this: if (int.TryParse("1234", out int result)) { /* do stuff */ }


If you count that than so can C/C++/Objective C (via pointers/references). But I like to use tuples and destructuring of tuples more (syntax wise).




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

Search: