top | item 45602123

(no title)

asimpletune | 4 months ago

Functions can accept/return multiple values though?

// In typescript const [a, b, c] = foo(d, e, f)

You could even pass this to itself

foo(…foo(d, e, f))

Also one definition of a function is a map from a domain to a range. There’s nothing that forbids multiple values, or is there?

discuss

order

maweki|4 months ago

The range can be a product type, as can the domain. Most languages are expressive enough that you can create the product type (struct). You're right on point.