Return multiple values
Each function officially returns one value, but by returning a List or Seq you can transparently return a list of arbitrary (even infinite) size. The calling scope can destructure the list using assignment, if it so chooses:
In this example, the variable $add
now holds the number 10, and $mul
the number 21.
Last updated