It was the most well-known language I could think of that actually supports returning multiple values. Lua supposedly allows it too, but it's limited. Simple things work
function dup(x) return x, x end function add(x,y) return x, y end print(add(dup(3))) -- prints 6but more somplex examples, such as
function dup(x) return x, x end function mad(x,y,z) return x*y+z end print(mad(dup(dup(3))))don't. I'm not sure it can work in a non-stack-based language.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds