Return multiple values

From Fōrmulæ wiki
Jump to: navigation, search

This page is the answer to the task Return multiple value in the Rosetta Code.

Description (from Rosetta Code)

Task

Show how to return more than one value from a function.

Solution

Every function returns one value. The conventional way to return multiple values is to return a list.

In the following example, the function returns the sum and product of two given numbers.

ReturnMultipleValues1.png

ReturnMultipleValues2.png