<br><br><div class="gmail_quote">On Mon, Sep 27, 2010 at 08:17, Shin Fujishiro <span dir="ltr">&lt;<a href="mailto:rsinfu@gmail.com">rsinfu@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
I&#39;m willing to add more tuple algorithms to phobos for easing<br>
metaprogramming in D.  Here&#39;s code and example:<br>
<br>
  <a href="http://gist.github.com/598659" target="_blank">http://gist.github.com/598659</a><br>
<br>
----------<br>
alias staticSort!(<br>
        q{ <a href="http://a.at" target="_blank">a.at</a>!(0).sizeof &lt; <a href="http://b.at" target="_blank">b.at</a>!(0).sizeof },<br>
        staticZip!( Wrap!(int, double, byte),<br>
                    Wrap!(&quot;x&quot;, &quot;y&quot;, &quot;z&quot;)))<br>
      A;<br>
pragma(msg, A);<br>
// tuple(Wrap!(byte,&quot;z&quot;),Wrap!(int,&quot;x&quot;),Wrap!(double,&quot;y&quot;))<br>
----------<br>
<br>
Built-in tuples have been able to store non-type compile-time entities.<br>
So, I propose we should rename the current TypeTuple to StaticTuple,<br>
and gather generic (non-type specific) tuple algorithms into a new<br>
module: std.meta.<br>
<br>
Does it sound good?<br>
<br>
<br>
Shin<br></blockquote><div><br>I&#39;m willing to review your code. I also feel Phobos should showcase D metaprogramming on types. At a minimum, filtering, reducing, scanning (reduce with history), rotating and inverting tuples should be there. <br>
<br>As for calling TypeTuple a StaticTuple, I prefer to keep TypeTuple. By convergent evolution, I have lots of template that do similar things to your and can confirm these are not just an intellectual exercise: as soon as you transform functions for example, you need to transform their parameters typetuple. The same for transforming a class/struct inner types, etc. <br>
I also choose to call them staticStuff, but it&#39;s becoming a bit cumbersome... Any idea to simplify the names would be welcome.<br><br>I decided to separate those acting on typetuple and those acting on expression tuples / std.typecons.Tuple. <br>
My code is here:<br><br><a href="http://www.dsource.org/projects/dranges/browser/trunk/dranges/typetuple.d">http://www.dsource.org/projects/dranges/browser/trunk/dranges/typetuple.d</a><br><a href="http://www.dsource.org/projects/dranges/browser/trunk/dranges/variadic.d">http://www.dsource.org/projects/dranges/browser/trunk/dranges/variadic.d</a><br>
<a href="http://www.dsource.org/projects/dranges/browser/trunk/dranges/tuple.d">http://www.dsource.org/projects/dranges/browser/trunk/dranges/tuple.d</a><br><br>If think most templates dealing with type tuples (or rather, template arguments tuples) should go in std.typetuple.<br>
Those acting on expression tuples could go in std.variadic.<br><br><br>Philippe<br><br></div></div>