digitalmars.D - std.templatecons ready for comments
- Ilya Yaroshenko (12/12) Nov 10 2013 Hello, All!
- Ilya Yaroshenko (2/2) Nov 10 2013 D.announce:
- David Nadlinger (8/10) Nov 10 2013 I don't have the time right now to actually review the proposal,
- Ilya Yaroshenko (3/14) Nov 10 2013 Can I include it instead of Curry?
- Dicebot (8/8) Nov 10 2013 (x-post from .announce:)
- John Colvin (7/15) Nov 11 2013 I agree. I have a partial (most of the big stuff) port of
- Dicebot (5/11) Nov 11 2013 I am proposing to implement superseding package/modules in term
- John Colvin (19/31) Nov 11 2013 My approach is to use two distinct types, Seq and Pack. The
- Ilya Yaroshenko (2/2) Nov 10 2013 Is it any reason why Temps[0]!(Arg) and
- Timon Gehr (8/10) Nov 10 2013 ! hasn't been assigned an associativity, maybe in order to make
- Jacob Carlborg (5/11) Nov 10 2013 Don't we already have some of this functionallity, like
- Ilya Yaroshenko (17/29) Nov 10 2013 Yes, for example template Filter(alias pred, TList...) from
- ilya-stromberg (9/10) Nov 11 2013 If you want to add `std.templatecons` into Phobos I suggest you
-
Denis Shelomovskij
(15/27)
Nov 11 2013
No more plain modules, please. Call it `std.meta.
`. - Denis Shelomovskij (10/41) Nov 11 2013 Sorry, accidental Ctrl+Enter. So let me continue:
- deadalnix (5/39) Nov 11 2013 Can we stop calling this tuples already ? I think one of the
- John Colvin (6/40) Nov 11 2013 How would you feel about me cannibalising parts of that for my
- John Colvin (2/46) Nov 11 2013 *somewhat disjoint
- Denis Shelomovskij (8/50) Nov 15 2013 Use it as you wish. Also feel free to e-mail me with
Hello, All! std.templatecons: Functional style template constructors. Documentation: http://9il.github.io/phobosx/std.templatecons.html Source: https://github.com/9il/phobosx/blob/master/std/templatecons.d Note: dmd >= 2.64 required Please destroy! I am sorry for my English in sources/docs. Best Regards, Ilya
Nov 10 2013
D.announce: http://forum.dlang.org/thread/qwmhsamadhupdlbvasul forum.dlang.org#post-nprfwcjtirujgmbqovnl:40forum.dlang.org
Nov 10 2013
On Sunday, 10 November 2013 at 15:30:29 UTC, Ilya Yaroshenko wrote:Documentation: http://9il.github.io/phobosx/std.templatecons.htmlI don't have the time right now to actually review the proposal, but here is a partial application (std.functional.curry is really a misnomer) template that supports skipping certain arguments: https://gist.github.com/klickverbot/1733753 (ConfinedTuple is the same as Pack in std.typetuple). David
Nov 10 2013
On Sunday, 10 November 2013 at 16:20:02 UTC, David Nadlinger wrote:On Sunday, 10 November 2013 at 15:30:29 UTC, Ilya Yaroshenko wrote:Can I include it instead of Curry?Documentation: http://9il.github.io/phobosx/std.templatecons.htmlI don't have the time right now to actually review the proposal, but here is a partial application (std.functional.curry is really a misnomer) template that supports skipping certain arguments: https://gist.github.com/klickverbot/1733753 (ConfinedTuple is the same as Pack in std.typetuple). David
Nov 10 2013
(x-post from .announce:) Had a very quick run-through the provided functionality. Looks nice and has some of utilities I tend to reinvent in my own code when doing meta-programming. Though I'd prefer to initiate creation of nested `std.meta` package and move such stuff there instead of adding yet another plain module. Also I am trying to negotiate with Andrei & Walter into deciding std.typetuple fate which may impact implementation of such module quite a lot :)
Nov 10 2013
On Sunday, 10 November 2013 at 16:37:30 UTC, Dicebot wrote:(x-post from .announce:) Had a very quick run-through the provided functionality. Looks nice and has some of utilities I tend to reinvent in my own code when doing meta-programming. Though I'd prefer to initiate creation of nested `std.meta` package and move such stuff there instead of adding yet another plain module. Also I am trying to negotiate with Andrei & Walter into deciding std.typetuple fate which may impact implementation of such module quite a lot :)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.
Nov 11 2013
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? :)
Nov 11 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: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.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? :)
Nov 11 2013
Is it any reason why Temps[0]!(Arg) and MetaTemps!(Arg)!(SecondArg) aren't allowed?
Nov 10 2013
On 11/10/2013 05:50 PM, Ilya Yaroshenko wrote:Is it any reason why Temps[0]!(Arg) andNo, this is just an arbitrary grammar limitation.MetaTemps!(Arg)!(SecondArg) aren't allowed?! hasn't been assigned an associativity, maybe in order to make disambiguation explicit: (MetaTemps!Arg)!SecondArg MetaTemps!(Arg!SecondArg) In any case. DMD rejects the first case because it parses it as an illegal C-style cast on a logical not expression.
Nov 10 2013
On 2013-11-10 16:30, Ilya Yaroshenko wrote:Hello, All! std.templatecons: Functional style template constructors. Documentation: http://9il.github.io/phobosx/std.templatecons.html Source: https://github.com/9il/phobosx/blob/master/std/templatecons.dDon't we already have some of this functionallity, like templateStaticMap and templateStaticIndexOf? -- /Jacob Carlborg
Nov 10 2013
On Sunday, 10 November 2013 at 17:54:13 UTC, Jacob Carlborg wrote:On 2013-11-10 16:30, Ilya Yaroshenko wrote:Yes, for example template Filter(alias pred, TList...) from std.typetuple. But alias templateFilter = ShellOneArg!Filter; is not the same as Filter. It can be used in compose/pipe and others: unittest { import std.complex, std.traits; alias Pipe = templatePipe!(templateFilter!isFloatingPoint, CommonType, Complex); static assert(is(Pipe!(bool[][], immutable float, const double, string) == Complex!double)); }Hello, All! std.templatecons: Functional style template constructors. Documentation: http://9il.github.io/phobosx/std.templatecons.html Source: https://github.com/9il/phobosx/blob/master/std/templatecons.dDon't we already have some of this functionallity, like templateStaticMap and templateStaticIndexOf?
Nov 10 2013
On Sunday, 10 November 2013 at 15:30:29 UTC, Ilya Yaroshenko wrote:std.templatecons: Functional style template constructors.If you want to add `std.templatecons` into Phobos I suggest you to add your code to the Review Queue: http://wiki.dlang.org/Review_Queue If you think that your code is ready, we can start more formal review after Robert Klotzner's `std.signal`. I'm shure Dicebot will help you as Review Manager: http://forum.dlang.org/thread/kiyfunngmuevxjurmjfh forum.dlang.org
Nov 11 2013
10.11.2013 19:30, Ilya Yaroshenko пишет:Hello, All! std.templatecons: Functional style template constructors. Documentation: http://9il.github.io/phobosx/std.templatecons.html Source: https://github.com/9il/phobosx/blob/master/std/templatecons.d Note: dmd >= 2.64 required Please destroy! I am sorry for my English in sources/docs. Best Regards, IlyaNo more plain modules, please. Call it `std.meta.<something>`. I'm against of including a few range-like (i.e. like `std.range` and `std.algorithm` stuff) templates like `RepeatExactly`, `templateStaticMap`, and `templateFilter`. First these are generic tuple manipulation templates belong to `std.meta.generictuple` (or how it's called now). Second I'd like to see one-to-one analog of all (most) applicable range operation functions for generic tuples in Phobos by merging in e.g. [1] As for `std.functional`-like template I can't tell much as the only ones http://denis-sh.bitbucket.org/unstandard/unstd.templates.html [1] http://denis-sh.bitbucket.org/unstandard/unstd.generictuple.html -- Денис В. Шеломовский Denis V. Shelomovskij
Nov 11 2013
12.11.2013 0:33, Denis Shelomovskij пишет:10.11.2013 19:30, Ilya Yaroshenko пишет:Sorry, accidental Ctrl+Enter. So let me continue: As for `std.functional`-like template I can't tell much as the only ones I really use are `unaryFun`/`binaryFun` and its string-to-function abilities which I also need for templates and which I also want to have in Phobos (see [2]). [2] http://denis-sh.bitbucket.org/unstandard/unstd.templates.html -- Денис В. Шеломовский Denis V. ShelomovskijHello, All! std.templatecons: Functional style template constructors. Documentation: http://9il.github.io/phobosx/std.templatecons.html Source: https://github.com/9il/phobosx/blob/master/std/templatecons.d Note: dmd >= 2.64 required Please destroy! I am sorry for my English in sources/docs. Best Regards, IlyaNo more plain modules, please. Call it `std.meta.<something>`. I'm against of including a few range-like (i.e. like `std.range` and `std.algorithm` stuff) templates like `RepeatExactly`, `templateStaticMap`, and `templateFilter`. First these are generic tuple manipulation templates belong to `std.meta.generictuple` (or how it's called now). Second I'd like to see one-to-one analog of all (most) applicable range operation functions for generic tuples in Phobos by merging in e.g. [1] As for `std.functional`-like template I can't tell much as the only ones http://denis-sh.bitbucket.org/unstandard/unstd.templates.html [1] http://denis-sh.bitbucket.org/unstandard/unstd.generictuple.html
Nov 11 2013
On Monday, 11 November 2013 at 20:33:37 UTC, Denis Shelomovskij wrote:10.11.2013 19:30, Ilya Yaroshenko пишет:Can we stop calling this tuples already ? I think one of the thing that everybody can agree upon is that calling that tuples is confusing everybody (including me).Hello, All! std.templatecons: Functional style template constructors. Documentation: http://9il.github.io/phobosx/std.templatecons.html Source: https://github.com/9il/phobosx/blob/master/std/templatecons.d Note: dmd >= 2.64 required Please destroy! I am sorry for my English in sources/docs. Best Regards, IlyaNo more plain modules, please. Call it `std.meta.<something>`. I'm against of including a few range-like (i.e. like `std.range` and `std.algorithm` stuff) templates like `RepeatExactly`, `templateStaticMap`, and `templateFilter`. First these are generic tuple manipulation templates belong to `std.meta.generictuple` (or how it's called now). Second I'd like to see one-to-one analog of all (most) applicable range operation functions for generic tuples in Phobos by merging in e.g. [1] As for `std.functional`-like template I can't tell much as the only ones http://denis-sh.bitbucket.org/unstandard/unstd.templates.html [1] http://denis-sh.bitbucket.org/unstandard/unstd.generictuple.html
Nov 11 2013
On Monday, 11 November 2013 at 20:33:37 UTC, Denis Shelomovskij wrote:10.11.2013 19:30, Ilya Yaroshenko пишет:How would you feel about me cannibalising parts of that for my attempt at making a proper std.meta module? Conveniently it seems that we use similar core ideas, but have implemented disjoint sets of functionality.Hello, All! std.templatecons: Functional style template constructors. Documentation: http://9il.github.io/phobosx/std.templatecons.html Source: https://github.com/9il/phobosx/blob/master/std/templatecons.d Note: dmd >= 2.64 required Please destroy! I am sorry for my English in sources/docs. Best Regards, IlyaNo more plain modules, please. Call it `std.meta.<something>`. I'm against of including a few range-like (i.e. like `std.range` and `std.algorithm` stuff) templates like `RepeatExactly`, `templateStaticMap`, and `templateFilter`. First these are generic tuple manipulation templates belong to `std.meta.generictuple` (or how it's called now). Second I'd like to see one-to-one analog of all (most) applicable range operation functions for generic tuples in Phobos by merging in e.g. [1] As for `std.functional`-like template I can't tell much as the only ones http://denis-sh.bitbucket.org/unstandard/unstd.templates.html [1] http://denis-sh.bitbucket.org/unstandard/unstd.generictuple.html
Nov 11 2013
On Monday, 11 November 2013 at 22:18:27 UTC, John Colvin wrote:On Monday, 11 November 2013 at 20:33:37 UTC, Denis Shelomovskij wrote:*somewhat disjoint10.11.2013 19:30, Ilya Yaroshenko пишет:How would you feel about me cannibalising parts of that for my attempt at making a proper std.meta module? Conveniently it seems that we use similar core ideas, but have implemented disjoint sets of functionality.Hello, All! std.templatecons: Functional style template constructors. Documentation: http://9il.github.io/phobosx/std.templatecons.html Source: https://github.com/9il/phobosx/blob/master/std/templatecons.d Note: dmd >= 2.64 required Please destroy! I am sorry for my English in sources/docs. Best Regards, IlyaNo more plain modules, please. Call it `std.meta.<something>`. I'm against of including a few range-like (i.e. like `std.range` and `std.algorithm` stuff) templates like `RepeatExactly`, `templateStaticMap`, and `templateFilter`. First these are generic tuple manipulation templates belong to `std.meta.generictuple` (or how it's called now). Second I'd like to see one-to-one analog of all (most) applicable range operation functions for generic tuples in Phobos by merging in e.g. [1] As for `std.functional`-like template I can't tell much as the only ones http://denis-sh.bitbucket.org/unstandard/unstd.templates.html [1] http://denis-sh.bitbucket.org/unstandard/unstd.generictuple.html
Nov 11 2013
12.11.2013 2:19, John Colvin пишет:On Monday, 11 November 2013 at 22:18:27 UTC, John Colvin wrote:Use it as you wish. Also feel free to e-mail me with questions/functionality requests (or open issues for Unstandard project). Just in case you want we also could make `unstd.meta` and then push to Phobos. -- Денис В. Шеломовский Denis V. ShelomovskijOn Monday, 11 November 2013 at 20:33:37 UTC, Denis Shelomovskij wrote:*somewhat disjoint10.11.2013 19:30, Ilya Yaroshenko пишет:How would you feel about me cannibalising parts of that for my attempt at making a proper std.meta module? Conveniently it seems that we use similar core ideas, but have implemented disjoint sets of functionality.Hello, All! std.templatecons: Functional style template constructors. Documentation: http://9il.github.io/phobosx/std.templatecons.html Source: https://github.com/9il/phobosx/blob/master/std/templatecons.d Note: dmd >= 2.64 required Please destroy! I am sorry for my English in sources/docs. Best Regards, IlyaNo more plain modules, please. Call it `std.meta.<something>`. I'm against of including a few range-like (i.e. like `std.range` and `std.algorithm` stuff) templates like `RepeatExactly`, `templateStaticMap`, and `templateFilter`. First these are generic tuple manipulation templates belong to `std.meta.generictuple` (or how it's called now). Second I'd like to see one-to-one analog of all (most) applicable range operation functions for generic tuples in Phobos by merging in e.g. [1] As for `std.functional`-like template I can't tell much as the only ones http://denis-sh.bitbucket.org/unstandard/unstd.templates.html [1] http://denis-sh.bitbucket.org/unstandard/unstd.generictuple.html
Nov 15 2013