[Issue 752] Assertion failure: 'e->type->ty != Ttuple' on line 4518 in file 'mtype.c'
BCS
nothing at pathlink.com
Fri Dec 29 21:13:55 PST 2006
Walter Bright wrote:
> Sean Kelly wrote:
>> d-bugmail at puremagic.com wrote:
>>>
>>> ------- Comment #2 from bugzilla at digitalmars.com 2006-12-29 21:43
>>> -------
>>> The statement:
>>>
>>> mixin .Tuple!((TList[1 .. $]))
>>>
>>> is actually invalid, as it attempts to make a tuple of tuples. Instead,
>>>
>>> mixin .Tuple!(TList[1 .. $])
>>>
>>> is correct.
>>
>> This seems a slim distinction. Adding a set of parenthesis makes the
>> code invalid?
>
> Sure, in the same way that:
>
> int foo( (int, char) );
>
> is not valid. Unless a compelling use case appears for the extra parens,
> I'd prefer to disallow it.
>
It would be vary handy to be able to make a member of a tuple be a tuple
it's self. the perens might be a good way to denote this rather than the
usual flattening.
It would allow a parser to convert a template parameter string to some
sort of tuple structure. This would be vary useful for parsing things.
In fact, that was the first way I planed to do my "d sprit" implementation.
http://www.webpages.uidaho.edu/~shro8822/dsprit.d
After finding that this didn't work, I went with the "parse as you go"
approach.
More information about the Digitalmars-d-bugs
mailing list