DIP for multiple auto ref values

Stefanos Baziotis sdi1600105 at di.uoa.gr
Tue Apr 9 19:35:24 UTC 2019


On Tuesday, 9 April 2019 at 18:15:30 UTC, Jacob Carlborg wrote:
> Technically returning a tuple would be returning a single 
> value. But the value is a collection of values, so it contains 
> multiple values. With some syntax sugar to auto expand the 
> tuple it's very similar, if not, exactly the same as returning 
> multiple values.

I might be wrong but:
The problem is not returning multiple values. The problem is 
returning multiple
ref values. Even if the tuple is built into the language, a tuple 
can't have ref
values because ref is not a type, a problem for which RefTuple 
was created.
RefTuple has difficult usage in an of itself for the users. As 
you can see, my
original proposal was to incorporate RefTuple to the language but 
RefTuple
is a struct and that comes with an overhead. So, the other idea 
is to do something
similar to what you say, i.e. auto-expand the tuple at 
compile-time but with the
support of ref values.


More information about the Digitalmars-d mailing list