Tuples a first class feature, manu's new unary operator and named arguments

Manu turkeyman at gmail.com
Sat May 9 07:08:50 UTC 2020


On Sat, May 9, 2020 at 2:45 PM Walter Bright via Digitalmars-d <
digitalmars-d at puremagic.com> wrote:

> On 5/8/2020 9:36 PM, Manu wrote:
> > It's still hideous though. Fundamental language features would ideally
> be
> > acknowledged and speced rather than expressed incidentally by an ugly
> hack.
>
> We can defer this discussion until the DIP is presented. But the existence
> of
> the AliasSeq should be discussed in the DIP as an alternative.
>

For instance, it would be nice for a function to return a tuple:
  AliasSeq!(int, float) mrv() { return AliasSeq!(1, 1.0f); }

But that doesn't really make sense from the perspective of the template arg
list hack we use, relative to a proper language tuple.
Instead we use a struct named `Tuple`, which isn't a tuple, it's a struct,
and it infers a lot about ABI, move/copy semantics, etc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20200509/4081afb4/attachment-0001.htm>


More information about the Digitalmars-d mailing list