On Tuesday, 4 April 2017 at 13:45:47 UTC, Meta wrote:
I mean what goes on inside fold. If you look at the C++ example
it's very concise and IMO beautiful:
auto f(Args ...args) { return (0 + ... +
args); }
It's special syntax for a very limited (only infix operators) and
rather obscure
On Tuesday, 4 April 2017 at 15:41:08 UTC, Russel Winder wrote:
Interestingly, or not, Python 3.6 introduces string
interpolation even though Python already has the format
function. And pythonistas are happy about this.
I can say the redditor Python userbase wasn't. The same sentiment
was
On 03.04.2017 23:43, Meta wrote:
On Monday, 3 April 2017 at 21:33:20 UTC, Timon Gehr wrote:
On 03.04.2017 20:24, Meta wrote:
On Monday, 3 April 2017 at 08:53:57 UTC, Andrea Fontana wrote:
https://isocpp.org/files/papers/p0636r0.html
The fold expressions and inference of constructor template
On Tuesday, 4 April 2017 at 13:30:47 UTC, Meta wrote:
On Tuesday, 4 April 2017 at 08:38:32 UTC, Walter Bright wrote:
http://dlang.org/phobos/std_algorithm_iteration.html#.fold
Not quite the same as this is a fold over a TypeTuple/AliasSeq.
You could of course do:
only(args).fold!"a + b"()
On Tue, Apr 04, 2017 at 01:38:32AM -0700, Walter Bright via Digitalmars-d wrote:
> On 4/3/2017 11:24 AM, Meta wrote:
> > I don't know how fold expressions could be emulated in D.
>
> http://dlang.org/phobos/std_algorithm_iteration.html#.fold
That is not what "fold expressions" mean. Fold
On Tue, 2017-04-04 at 12:46 +, Xinok via Digitalmars-d wrote:
> On Tuesday, 4 April 2017 at 02:43:26 UTC, evilrat wrote:
> > String interpolation would be nice too, it would really help
> > with readability!
>
> This really isn't in the spirit of D and is better left to
> library functions
On 04/04/2017 03:45 PM, Meta wrote:
I mean what goes on inside fold.
Ok. That's what I missed.
If you look at the C++ example it's
very concise and IMO beautiful:
auto f(Args ...args) { return (0 + ... + args); }
But the shown `fold` implements the functionality of that C++ language
On Tuesday, 4 April 2017 at 13:45:47 UTC, Meta wrote:
I mean what goes on inside fold. If you look at the C++ example
it's very concise and IMO beautiful:
Luckily that hardly matters, you just need to define one generic
template for the whole program, which can even be in a library.
Btw my
On Tuesday, 4 April 2017 at 13:38:57 UTC, ag0aep6g wrote:
On 04/04/2017 03:29 PM, Meta wrote:
On Tuesday, 4 April 2017 at 05:04:04 UTC, Dukc wrote:
[...]
fold!"+"(1, 2, 3).writeln; //6
[...]
However, it's still more verbose. My goal was to emulate
almost exactly
what C++ was doing by
On 04/04/2017 03:29 PM, Meta wrote:
On Tuesday, 4 April 2017 at 05:04:04 UTC, Dukc wrote:
[...]
fold!"+"(1, 2, 3).writeln; //6
[...]
However, it's still more verbose. My goal was to emulate almost exactly
what C++ was doing by using a template so you could just write
"fold!('+', args)"
On Tuesday, 4 April 2017 at 08:38:32 UTC, Walter Bright wrote:
On 4/3/2017 11:24 AM, Meta wrote:
I don't know how fold expressions could be emulated in D.
http://dlang.org/phobos/std_algorithm_iteration.html#.fold
Not quite the same as this is a fold over a TypeTuple/AliasSeq.
You could of
On Tuesday, 4 April 2017 at 05:04:04 UTC, Dukc wrote:
On Monday, 3 April 2017 at 21:43:41 UTC, Meta wrote:
On Monday, 3 April 2017 at 21:33:20 UTC, Timon Gehr wrote:
Any suggestions as to how to get something similar working?
auto fold(string op, Args...)(Args args)
{
foreach(e; args[1 ..
On Tuesday, 4 April 2017 at 02:43:26 UTC, evilrat wrote:
String interpolation would be nice too, it would really help
with readability!
This really isn't in the spirit of D and is better left to
library functions which give the user far more power and
flexibility. Incorporating such a
On Tuesday, 4 April 2017 at 10:40:19 UTC, Guillaume Piolat wrote:
On Tuesday, 4 April 2017 at 08:16:48 UTC, evilrat wrote:
Well, thanks, I guess... But it seems no one else interested
in such feature. I get it.
Sure this shouldn't be top priority thing and it can(it surely
will) be hard to
On Tuesday, 4 April 2017 at 08:16:48 UTC, evilrat wrote:
Well, thanks, I guess... But it seems no one else interested in
such feature. I get it.
Sure this shouldn't be top priority thing and it can(it surely
will) be hard to implement in compiler, and this maybe not an
option for such a
On 4/3/2017 11:24 AM, Meta wrote:
I don't know how fold expressions could be emulated in D.
http://dlang.org/phobos/std_algorithm_iteration.html#.fold
On Tuesday, 4 April 2017 at 07:21:09 UTC, Andrea Fontana wrote:
On Tuesday, 4 April 2017 at 06:13:24 UTC, evilrat wrote:
On Tuesday, 4 April 2017 at 05:53:00 UTC, Patrick Schluter
wrote:
On Tuesday, 4 April 2017 at 05:36:55 UTC, evilrat wrote:
On Tuesday, 4 April 2017 at 05:18:26 UTC, Dukc
On Tuesday, 4 April 2017 at 06:13:24 UTC, evilrat wrote:
On Tuesday, 4 April 2017 at 05:53:00 UTC, Patrick Schluter
wrote:
On Tuesday, 4 April 2017 at 05:36:55 UTC, evilrat wrote:
On Tuesday, 4 April 2017 at 05:18:26 UTC, Dukc wrote:
On Tuesday, 4 April 2017 at 02:43:26 UTC, evilrat wrote:
On Tuesday, 4 April 2017 at 05:53:00 UTC, Patrick Schluter wrote:
On Tuesday, 4 April 2017 at 05:36:55 UTC, evilrat wrote:
On Tuesday, 4 April 2017 at 05:18:26 UTC, Dukc wrote:
On Tuesday, 4 April 2017 at 02:43:26 UTC, evilrat wrote:
[...]
writeln("Your item: ", someName, " = ",
On Tuesday, 4 April 2017 at 05:36:55 UTC, evilrat wrote:
On Tuesday, 4 April 2017 at 05:18:26 UTC, Dukc wrote:
On Tuesday, 4 April 2017 at 02:43:26 UTC, evilrat wrote:
[...]
But if all you want is to construct some code in
interpreter-like way at compile time, string mixin does
precisely
On Tuesday, 4 April 2017 at 05:18:26 UTC, Dukc wrote:
On Tuesday, 4 April 2017 at 02:43:26 UTC, evilrat wrote:
String interpolation would be nice too, it would really help
with readability!
But if all you want is to construct some code in
interpreter-like way at compile time, string mixin
On Tuesday, 4 April 2017 at 02:43:26 UTC, evilrat wrote:
String interpolation would be nice too, it would really help
with readability!
If you mean runtime interpolation, that means one has to bundle
the interpreter with the executable, and sacrifice alot of code
speed. I recall that there
^ sorry misquote
On Monday, 3 April 2017 at 21:43:41 UTC, Meta wrote:
On Monday, 3 April 2017 at 21:33:20 UTC, Timon Gehr wrote:
Any suggestions as to how to get something similar working?
auto fold(string op, Args...)(Args args)
{
foreach(e; args[1 .. $]) args[0] += e;
return args[0];
}
void main()
{
On Tuesday, 4 April 2017 at 00:46:25 UTC, mogu wrote:
On Monday, 3 April 2017 at 18:24:31 UTC, Meta wrote:
On Monday, 3 April 2017 at 08:53:57 UTC, Andrea Fontana wrote:
https://isocpp.org/files/papers/p0636r0.html
The fold expressions and inference of constructor template
args look very
On Monday, 3 April 2017 at 18:24:31 UTC, Meta wrote:
On Monday, 3 April 2017 at 08:53:57 UTC, Andrea Fontana wrote:
https://isocpp.org/files/papers/p0636r0.html
The fold expressions and inference of constructor template args
look very nice. C++ is quickly catching up to D in a lot of
areas,
On Monday, 3 April 2017 at 21:33:20 UTC, Timon Gehr wrote:
On 03.04.2017 20:24, Meta wrote:
On Monday, 3 April 2017 at 08:53:57 UTC, Andrea Fontana wrote:
https://isocpp.org/files/papers/p0636r0.html
The fold expressions and inference of constructor template
args look
very nice. C++ is
On 03.04.2017 20:24, Meta wrote:
On Monday, 3 April 2017 at 08:53:57 UTC, Andrea Fontana wrote:
https://isocpp.org/files/papers/p0636r0.html
The fold expressions and inference of constructor template args look
very nice. C++ is quickly catching up to D in a lot of areas, although
usually
On Monday, 3 April 2017 at 08:53:57 UTC, Andrea Fontana wrote:
https://isocpp.org/files/papers/p0636r0.html
The fold expressions and inference of constructor template args
look very nice. C++ is quickly catching up to D in a lot of
areas, although usually still with worse syntax. I don't
https://isocpp.org/files/papers/p0636r0.html
30 matches
Mail list logo