So I've been learning D since the day 11 (I posted for first time
here) and now I've decided to try Vibe.D to make my company API.
The fact is that I've achieved to do it (according to the
provided code) and it works! But it shows a default message and
on the startup. So I'd like to know how c
On Sat, Mar 03, 2018 at 01:13:43AM +0100, Christian Köstlin via
Digitalmars-d-learn wrote:
> >> class Timer : Thread {
> >> override Timer start() { ... }
> >> }
> >>
> >> https://dlang.org/spec/function.html#virtual-functions
> >>
> >> (see item 6)
> >>
> >> -Steve
> > Thanks for this.
> > It
>> class Timer : Thread {
>> override Timer start() { ... }
>> }
>>
>> https://dlang.org/spec/function.html#virtual-functions
>>
>> (see item 6)
>>
>> -Steve
> Thanks for this.
> It works for me only without the override (with override I get
> Error: function timer.Timer.start does not override
On 02.03.18 21:39, Steven Schveighoffer wrote:
> On 3/2/18 3:23 PM, Christian Köstlin wrote:
>> To give an example:
>>
>> class Thread {
>> ...
>> Thread start() {...}
>> }
>>
>> class Timer : Thread {
>> ...
>> }
>>
>>
>> void main() {
>> // Timer timer = new Timer().start; // this do
On 3/2/18 3:26 PM, Nordlöw wrote:
On Wednesday, 28 February 2018 at 20:07:50 UTC, Steven Schveighoffer wrote:
auto x = cast(Object)((cast(size_t *)null) + 1);
Is this preferred performance-wise over `cast(void*)(size_t.max)`?
No, it just works, as opposed to, um... not working ;)
I think th
On 3/2/18 3:23 PM, Christian Köstlin wrote:
To give an example:
class Thread {
...
Thread start() {...}
}
class Timer : Thread {
...
}
void main() {
// Timer timer = new Timer().start; // this does not work
auto timer = new Timer().start; // because timer is of type Thread
}
On Wednesday, 28 February 2018 at 20:07:50 UTC, Steven
Schveighoffer wrote:
auto x = cast(Object)((cast(size_t *)null) + 1);
Is this preferred performance-wise over `cast(void*)(size_t.max)`?
To give an example:
class Thread {
...
Thread start() {...}
}
class Timer : Thread {
...
}
void main() {
// Timer timer = new Timer().start; // this does not work
auto timer = new Timer().start; // because timer is of type Thread
}
thanks in advance,
christian
On 3/2/18 9:23 AM, Steven Schveighoffer wrote:
On 3/1/18 11:50 PM, Nick Sabalausky (Abscissa) wrote:
How could this be accomplished? Is it even possible?
You'd have to do this in the parent. You can duplicate the file
descriptor, so that writing to either goes to the same spot, but you
can't
On 3/1/18 11:50 PM, Nick Sabalausky (Abscissa) wrote:
I'd like to include this functionality in Scriptlike, but I don't know
if it's even possible:
Launch a process (spawnProcess, pipeShell, etc) so the child's
stdout/stderr go to the parent's stdout/stderr *without* the possibility
of them g
On 3/1/18 5:59 PM, ag0aep6g wrote:
On 03/01/2018 11:43 PM, Jamie wrote:
So if I do
arr[0 .. 1][0] = 3;
shouldn't this return
[[3, 0, 0], [0, 0, 0]] ? Because I'm taking the slice arr[0 ..
1], or arr[0], which is the first [0, 0, 0]?
arr[0 .. 1] is not the same as arr[0].
arr[0 .. 1
On Wednesday, 28 February 2018 at 18:23:04 UTC, Jiyan wrote:
The nodes are only allocated over malloc(). So i have to take
care of the initialisation myself.
The problem is, that i found out by debugging, that it seems
that when i call val.opAssign(op) in constructNodeFrom(), there
isn't any po
On Friday, 2 March 2018 at 10:32:08 UTC, Jonathan M Davis wrote:
foreach does not support indices for ranges, only arrays. When
you have
foreach(e; range)
it gets lowered to
foreach(auto __range = range; !__range.empty;
__range.popFront())
{
auto e = __range.front;
}
There are no indic
On Friday, 2 March 2018 at 10:34:31 UTC, bauss wrote:
You can also call "array" from "std.array".
auto range = iota(5).array;
foreach (i, el; range) {
writeln(i, ": ", el);
}
Thank you. That's how I had it in my original code, I was just
trying to avoid gratuitous memory
On Wednesday, 28 February 2018 at 18:27:49 UTC, Jiyan wrote:
On Wednesday, 28 February 2018 at 18:23:04 UTC, Jiyan wrote:
Hey,
i thought i had understood postblit, but in my Code the
following is happening (simplified):
struct C
{
this(this){/*Do sth*/}
list!C;
void opAssign(const C c)
{
"P
On Friday, 2 March 2018 at 10:27:27 UTC, Nicholas Wilson wrote:
try
https://dlang.org/phobos/std_range.html#enumerate
This worked. Thank you!
On Friday, 2 March 2018 at 08:25:51 UTC, dangbinghoo wrote:
So, does anyone know how to install latest ldc2 from arm-debain?
You can use the dlang install.sh script to download LDC and put
it in your home dir: https://dlang.org/install.html
-Johan
On Friday, 2 March 2018 at 10:21:39 UTC, Arredondo wrote:
Hi,
The following works as expected:
auto range = [1, 2, 3, 4, 5];
foreach (i, el; range) {
writeln(i, ": ", el);
}
but this slight modification doesn't:
auto range = iota(5);
foreach (i, el; range) {
writeln(i, ": ", e
On Friday, March 02, 2018 10:21:39 Arredondo via Digitalmars-d-learn wrote:
> Hi,
>
> The following works as expected:
>
> auto range = [1, 2, 3, 4, 5];
> foreach (i, el; range) {
> writeln(i, ": ", el);
> }
>
> but this slight modification doesn't:
>
> auto range = iota(5);
> foreach (i, el; ran
On Friday, 2 March 2018 at 10:21:39 UTC, Arredondo wrote:
Hi,
The following works as expected:
auto range = [1, 2, 3, 4, 5];
foreach (i, el; range) {
writeln(i, ": ", el);
}
but this slight modification doesn't:
auto range = iota(5);
foreach (i, el; range) {
writeln(i, ": ", e
Hi,
The following works as expected:
auto range = [1, 2, 3, 4, 5];
foreach (i, el; range) {
writeln(i, ": ", el);
}
but this slight modification doesn't:
auto range = iota(5);
foreach (i, el; range) {
writeln(i, ": ", el);
}
DMD 2.078.3 says:
Error: cannot infer argument types
On 02/03/2018 11:21 PM, Arredondo wrote:
Hi,
The following works as expected:
auto range = [1, 2, 3, 4, 5];
foreach (i, el; range) {
writeln(i, ": ", el);
}
s/range/array/
Arrays have a different foreach syntax than ranges do.
On Friday, 2 March 2018 at 10:08:57 UTC, Simen Kjærås wrote:
This is of course only partly true.
while ((*dst++ = *src++) != 0) {}
works just great, and also better shows what's actually being
tested for in the loop.
--
Simen
That's what I was after. Thanks!
On Friday, 2 March 2018 at 10:01:34 UTC, Jonathan M Davis wrote:
On Friday, March 02, 2018 09:44:20 psychoticRabbit via
Digitalmars-d-learn wrote:
trying to do this C code, in D, but getting error:
"Error: assignment cannot be used as a condition, perhaps `==`
was meant?"
any help much apprecia
On Friday, 2 March 2018 at 09:44:20 UTC, psychoticRabbit wrote:
trying to do this C code, in D, but getting error:
"Error: assignment cannot be used as a condition, perhaps `==`
was meant?"
any help much appreciated:
--
while ((*dst++ = *src++)) {}
--
You can't use this syntax insid
On Friday, March 02, 2018 09:44:20 psychoticRabbit via Digitalmars-d-learn
wrote:
> trying to do this C code, in D, but getting error:
> "Error: assignment cannot be used as a condition, perhaps `==`
> was meant?"
>
> any help much appreciated:
>
> --
> while ((*dst++ = *src++)) {}
> --
Y
trying to do this C code, in D, but getting error:
"Error: assignment cannot be used as a condition, perhaps `==`
was meant?"
any help much appreciated:
--
while ((*dst++ = *src++)) {}
--
On Friday, 2 March 2018 at 08:44:53 UTC, Gary Willoughby wrote:
It would be interesting to test whether those methods handle
these scenarios.
Yeah, it doesn't work.
https://dpaste.dzfl.pl/55116efd0c9c
On Thursday, 1 March 2018 at 12:20:08 UTC, Steven Schveighoffer
wrote:
On 3/1/18 7:05 AM, Gary Willoughby wrote:
On Thursday, 1 March 2018 at 10:10:27 UTC, John Burton wrote:
My question is how do I tell if a pointer is "garbage
collected" or not?
You could try `GC.addrOf()` or `GC.query()` i
hi there,
I just flased a armbain for nanoPi M3.
And, I just installed ldc2-1.2.0 armhf using apt-get. it compiles
d code with combination with gcc armhf and compiled program runs
great even the arch is aarch64.
But I realized that ldc2 is too old, I know that latest ldc2 is
1.8.0.
So, do
30 matches
Mail list logo