On Friday, 20 September 2013 at 06:20:09 UTC, Ali Çehreli wrote:
On 09/19/2013 04:32 AM, Dicebot wrote:
> Some obvious catches:
Thank you. I have made those changes except the following one.
> Variadic template arg chapter should probably mention
"variadic args of
> length 1" idiom used to hav
On 09/19/2013 04:32 AM, Dicebot wrote:
> Some obvious catches:
Thank you. I have made those changes except the following one.
> Variadic template arg chapter should probably mention "variadic args of
> length 1" idiom used to have parameter accepting types, values and
> aliases at once.
Could
On 09/19/2013 12:53 PM, H. S. Teoh wrote:
> I hope you're
> thoroughly confused and utterly perplexed by now
No, because you explained it very well. :)
> readers should instead be directed to std.traits
Indeed, I will add some :) of this information to the Traits chapter
which comes later in
On 09/19/2013 12:12 PM, Marek Janukowicz wrote:
> (why is your book not linked on dlang.org?
It will appear there once the translation is complete.
> how do I create a tuple at compile time if I'm getting
> information I want to put into it in a foreach? All the
> examples I found create a tupl
On Thu, Sep 19, 2013 at 09:12:10PM +0200, Marek Janukowicz wrote:
> Ali Çehreli wrote:
[...]
> > As far as I know, static foreach is only for tuples (or TypeTuples).
> > If you can generate the AA as a tuple, then the foreach will be
> > evaluated at compile time.
>
> I read your articles about tu
On Thu, Sep 19, 2013 at 12:46:39AM -0700, Ali Çehreli wrote:
> On 09/17/2013 07:26 PM, H. S. Teoh wrote:
>
> > On Wed, Sep 18, 2013 at 04:12:01AM +0200, John Colvin wrote:
> >> On Wednesday, 18 September 2013 at 01:24:37 UTC, Ali Çehreli wrote:
> >>> As far as I know, static foreach is only for tu
Ali Çehreli wrote:
> On 09/16/2013 01:24 PM, Marek Janukowicz wrote:
>
> >static string[string] columns () {
> // ...
> >}
>
> Although the function itself is static, it returns a dynamic value.
>
> > foreach( attr, col; columns() ) {
> >__traits(getMember, me, attr) =
On Thursday, 19 September 2013 at 07:46:41 UTC, Ali Çehreli wrote:
I have just published two chapters that present tuples and
TypeTuple sufficiently-completely and sufficiently-consistently
(of course, according to me ;) ):
Tuples:
http://ddili.org/ders/d.en/tuples.html
More Templates:
On 09/17/2013 07:26 PM, H. S. Teoh wrote:
> On Wed, Sep 18, 2013 at 04:12:01AM +0200, John Colvin wrote:
>> On Wednesday, 18 September 2013 at 01:24:37 UTC, Ali Çehreli wrote:
>>> As far as I know, static foreach is only for tuples (or TypeTuples)
>>
>> TypeTuples are tuples. Sortof. We really ne
On Wed, Sep 18, 2013 at 04:12:01AM +0200, John Colvin wrote:
> On Wednesday, 18 September 2013 at 01:24:37 UTC, Ali Çehreli wrote:
> >As far as I know, static foreach is only for tuples (or TypeTuples)
>
> TypeTuples are tuples. Sortof. We really need to get that whole
> situation sorted
Not
On Wednesday, 18 September 2013 at 01:24:37 UTC, Ali Çehreli
wrote:
As far as I know, static foreach is only for tuples (or
TypeTuples)
TypeTuples are tuples. Sortof. We really need to get that whole
situation sorted
On 09/16/2013 01:24 PM, Marek Janukowicz wrote:
>static string[string] columns () {
// ...
>}
Although the function itself is static, it returns a dynamic value.
> foreach( attr, col; columns() ) {
>__traits(getMember, me, attr) = typeof(__traits(getMember, me,
> attr)).ini
Ali Çehreli wrote:
> Could you please provide complete code.
Sure. This is of course stripped down just for demonstration purposes:
struct Attr {
string name;
}
mixin template Model() {
static string[string] columns () {
string[string] cols;
alias type = typeof(this);
// Basica
Could you please provide complete code.
Thank you,
Ali
I need to gather some data in compile time basing on UDA.
struct Attr {
string name;
}
mixin template Model() {
static string[string] columns () {
string[string] cols;
alias type = typeof(this);
// Basically - get all members with @Attr UDA and build AA out of those
foreach(
15 matches
Mail list logo