Jump to page: 1 2
Thread overview
std.templatecons ready for comments
Nov 10, 2013
Ilya Yaroshenko
Nov 10, 2013
Ilya Yaroshenko
Nov 10, 2013
David Nadlinger
Nov 10, 2013
Ilya Yaroshenko
Nov 10, 2013
Dicebot
Nov 11, 2013
John Colvin
Nov 11, 2013
Dicebot
Nov 11, 2013
John Colvin
Nov 10, 2013
Ilya Yaroshenko
Nov 10, 2013
Timon Gehr
Nov 10, 2013
Jacob Carlborg
Nov 10, 2013
Ilya Yaroshenko
Nov 11, 2013
ilya-stromberg
Nov 11, 2013
Denis Shelomovskij
Nov 11, 2013
Denis Shelomovskij
Nov 11, 2013
deadalnix
Nov 11, 2013
John Colvin
Nov 11, 2013
John Colvin
Nov 15, 2013
Denis Shelomovskij
November 10, 2013
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
November 10, 2013
D.announce:
http://forum.dlang.org/thread/qwmhsamadhupdlbvasul@forum.dlang.org#post-nprfwcjtirujgmbqovnl:40forum.dlang.org
November 10, 2013
On Sunday, 10 November 2013 at 15:30:29 UTC, Ilya Yaroshenko wrote:
> Documentation:
> http://9il.github.io/phobosx/std.templatecons.html

I 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
November 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 :)
November 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:
>> Documentation:
>> http://9il.github.io/phobosx/std.templatecons.html
>
> I 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

Can I include it instead of Curry?
November 10, 2013
Is it any reason why Temps[0]!(Arg) and
MetaTemps!(Arg)!(SecondArg) aren't allowed?
November 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.d

Don't we already have some of this functionallity, like templateStaticMap and templateStaticIndexOf?

-- 
/Jacob Carlborg
November 10, 2013
On Sunday, 10 November 2013 at 17:54:13 UTC, Jacob Carlborg wrote:
> 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.d
>
> Don't we already have some of this functionallity, like templateStaticMap and templateStaticIndexOf?

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));
}
November 10, 2013
On 11/10/2013 05:50 PM, Ilya Yaroshenko wrote:
> Is it any reason why Temps[0]!(Arg) and

No, 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.
November 11, 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
« First   ‹ Prev
1 2