This always forces us to return a single parameter in case I need to return multiple, say a List and a String. This restriction is not there in function arguments.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This problem is what functional languages such as F#, haskell etc. attempt to address. The problem is that in hardware, a function’s return value was originally returned via a CPU register, so you could only return a single value. C syntax passed on this legacy and C++ (and C#, Java) also inherited this.