grauzone wrote:
Walter Bright wrote:
bearophile wrote:
Walter Bright:
There are significant technical problems with having functions return tuples.<

A possibly stupid question: isn't it enough to return a custom struct?

No, because of the alignment mismatches with other uses of tuples.

I don't understand, what does alignment have to do with such a high level construct?

You can use a tuple to populate a struct with fields, and it's interchangeable with manually populating the fields. You can also use a tuple to pass args to a function, and it's interchangeable with manually listing the args.

But if you populate a struct with a tuple, then pass the struct as an arg, it is *not* interchangeable with manually listing the args, as the alignment is different.

Reply via email to