On Friday, 24 August 2018 at 15:18:13 UTC, Peter Alexander wrote:
Consider this code, which is used as an example only:
auto scaleAll(int[] xs, int m) {
return xs.map!(x => m * x);
}
As m is captured, the delegate for map will rightly allocate
the closure in the GC heap.
In C++, you would
On Sunday, 26 August 2018 at 02:26:58 UTC, Everlast wrote:
The problem is, suppose one wants to specify A
void print(T, int... A)(T t, A a)
while tricks can be used, why doesn't D support such an obvious
syntax? We can specify an arbitrary type but can't restrict it
in an obvious way, in fact
void print()
{
}
void print(T, A...)(T t, A a)
{
import std.stdio;
writeln(t);
print(a);
}
The problem is, suppose one wants to specify A
void print(T, int... A)(T t, A a)
while tricks can be used, why doesn't D support such an obvious
syntax? We can specify an arbitrary type but
On Friday, 24 August 2018 at 17:36:25 UTC, Matthew OConnor wrote:
I'd like to run a sequence of executables with something like
std.process.execute, but I would like the sequence to error out
if one of the executables returns a non-zero return code. What
is the recommended way to do this? A wra
On Saturday, 25 August 2018 at 22:00:47 UTC, JN wrote:
It's kind of a dirty and not very portable solution, but if you
run by executeShell, you could so something like
executeShell("cmd1 && cmd2 && cmd3") and let the shell do the
sequence for you.
Oops, didn't notice it was suggested already.
On Saturday, 25 August 2018 at 20:37:04 UTC, Everlast wrote:
On Saturday, 25 August 2018 at 20:28:55 UTC, Chris M. wrote:
On Saturday, 25 August 2018 at 20:17:35 UTC, AN wrote:
I downloaded the script and made it executable. I also have
dub on `/usr/bin/dub` . The example just stalls with no
o
On Saturday, 25 August 2018 at 20:28:55 UTC, Chris M. wrote:
On Saturday, 25 August 2018 at 20:17:35 UTC, AN wrote:
I downloaded the script and made it executable. I also have
dub on `/usr/bin/dub` . The example just stalls with no
output. After fidgeting around for 5 minutes I realized it was
On Saturday, 25 August 2018 at 20:17:35 UTC, AN wrote:
I downloaded the script and made it executable. I also have dub
on `/usr/bin/dub` . The example just stalls with no output.
After fidgeting around for 5 minutes I realized it was
downloading silently in the background. (I think for homepage
I downloaded the script and made it executable. I also have dub
on `/usr/bin/dub` . The example just stalls with no output. After
fidgeting around for 5 minutes I realized it was downloading
silently in the background. (I think for homepage examples, they
should be running in verbose mode as th
On 2018-08-25 15:33, SG wrote:
Hi,
1) I program in C# and I'm wondering if there is something like ??
(Null-Coalescing Operator) in D? (I remember some proposals in the past).
Not in the language but it can be implemented as a library function by
overloading "opDispatch". See [1] for an exam
Thanks a lot.
The issue was indeed the time zone.
Issue filed: https://issues.dlang.org/show_bug.cgi?id=19190
On Saturday, August 25, 2018 6:53:24 AM MDT Ivo via Digitalmars-d-learn
wrote:
> I am using Clock.currTime.stdTime to get a unique timestamp in my
> program.
> Now I need to produce something similar in a different
> programming language; so I'm trying to understand how
> Clock.currTime works.
>
>
On Saturday, 25 August 2018 at 14:13:18 UTC, rikki cattermole
wrote:
On 26/08/2018 2:10 AM, Yuxuan Shui wrote:
The offending code base is a little big and hard to reduce.
I'll try if code is required, but here is the gist of the
problem:
This snippet of code in my project:
...
alia
On 26/08/2018 2:10 AM, Yuxuan Shui wrote:
The offending code base is a little big and hard to reduce. I'll try if
code is required, but here is the gist of the problem:
This snippet of code in my project:
...
alias tmp = genCode!T;
enum str = tmp.str; // This line here
...
The offending code base is a little big and hard to reduce. I'll
try if code is required, but here is the gist of the problem:
This snippet of code in my project:
...
alias tmp = genCode!T;
enum str = tmp.str; // This line here
...
Generate a circular reference error.
However,
On Saturday, 25 August 2018 at 13:42:30 UTC, JN wrote:
2) Yes, through UFCS (Uniform Function Call Syntax). It doesn't
require any special syntax, for example:
Very simple indeed.
Thanks.
On Saturday, 25 August 2018 at 13:33:58 UTC, SG wrote:
Hi,
1) I program in C# and I'm wondering if there is something like
?? (Null-Coalescing Operator) in D? (I remember some proposals
in the past).
2) Is possible to create Extensions like in C#?
For example:
public int StrToInt (this st
Hi,
1) I program in C# and I'm wondering if there is something like
?? (Null-Coalescing Operator) in D? (I remember some proposals in
the past).
2) Is possible to create Extensions like in C#?
For example:
public int StrToInt (this string s){
return int.Parse(s);
}
var i = "123456".Str
I am using Clock.currTime.stdTime to get a unique timestamp in my
program.
Now I need to produce something similar in a different
programming language; so I'm trying to understand how
Clock.currTime works.
According the the documentation Clock.currTime.stdTime should
return the number of hnse
20 matches
Mail list logo