Wait, what? What is AliasSeq?

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Thu Jul 16 02:18:37 PDT 2015


On 2015-07-16 10:00, "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm at gmx.net>" 
wrote:

> What I meant is that there is no equivalent to the behaviour of TypeTuples:
>
>      assert(is(TypeTuple!(int, float, TypeTuple!(string, int)) ==
>                TypeTuple!(int, float, string, int));
>      TypeTuple!(int, int) a;
>      a[0] = 1; a[1] = 2;
>      void foo(int, int);
>      foo(a); // works
>
> But not in Ruby:
>
>      [1, 2, [3, 4]] != [1, 2, 3, 4]
>      def foo a, b ; end
>      foo([1, 2]);  // doesn't work
>      foo(*[1, 2]); // but works with splat operator
>
> Maybe auto-flattening is a better name for this behaviour?
>
> My point is that there is no type in Ruby that is inherently "splatty",
> rather it's the operator that produces this behaviour. Therefore,
> "splat" is not used as a noun to signify such a type.

I see what you mean now.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list