Elegant ways to return multiple values from a function

后端 未结 14 895
梦谈多话
梦谈多话 2020-12-15 03:49

It seems like in most mainstream programming languages, returning multiple values from a function is an extremely awkward thing.

The typical soluti

14条回答
  •  猫巷女王i
    2020-12-15 04:43

    Here was my Ruby idea to return a special value that looks and acts like a scalar but actually has hidden attributes on it:

    https://gist.github.com/2305169

提交回复
热议问题