std.templatecons ready for comments
John Colvin
john.loughran.colvin at gmail.com
Mon Nov 11 14:09:50 PST 2013
On Monday, 11 November 2013 at 20:37:49 UTC, Dicebot wrote:
> On Monday, 11 November 2013 at 17:35:26 UTC, John Colvin wrote:
>> I agree. I have a partial (most of the big stuff) port of
>> std.algorithm and std.functional for 'Seq's or whatever we
>> want to call them now, I'll try and whip it up in to a
>> std.meta module with appropriate sub-modules ASAP for
>> discussion/comparison. I am quite pleased with what I've got
>> so far, hopefully I'll have it ready to show during the next
>> week.
>
> I am proposing to implement superseding package/modules in term
> of template argument list with no auto-expansion to avoid
> having two distinct types for that and making signatures a bit
> more hygienic. Will that be much of a burden? :)
My approach is to use two distinct types, Seq and Pack. The
combination is actually quite acceptable to use, but I'm open to
alternatives. To be honest, I used to feel that auto-expanding
tuples were a pain, but once one has decent tools to work with -
like I'm trying to create - it isn't much of a problem.
Some sort of syntax to create non-expanding tuples, whether as a
builtin concept or sugar for a library construct* would be nice,
otherwise the already ugly heavy nested parenthesis are made
worse by having Pack!(...) everywhere. ';' delimited parameter
lists would be one way to do this quite nicely IMO, although
there are also a good number of other characters that would be
unambiguous in that concept.
*preferable, obviously.
To answer your question directly: My work uses auto-expanding
Seqs quite a bit, but I can't think of anything that couldn't be
immediately re-implemented with non-expanding. Without a nice
syntax like ';' delimited parameter lists, it would probably be
uglier than it currently can be with auto-expanding.
More information about the Digitalmars-d
mailing list