Re: Disk space used and free size of a Network share folder in Windows

2018-02-16 Thread Vino via Digitalmars-d-learn
On Thursday, 15 February 2018 at 20:43:32 UTC, Johan Engelen wrote: On Wednesday, 14 February 2018 at 12:22:09 UTC, Vino wrote: Hi All, Request your help on how to get the disk space used and free size of a Network share folder in Windows, tried with getSize but it return 0; See:

Appending to ddoc macros

2018-02-16 Thread Jonathan M Davis via Digitalmars-d-learn
Does anyone know if there's a way to append to a ddoc macro instead of replacing it? For instance, dlang.org has the EXTRA_HEADERS macro for adding extra stuff to the header of a web page, and it uses that with several pages defining EXTRA_HEADERS to add headers to that specific page. I have

Re: std.zip size limit of 2 GB?

2018-02-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/16/18 5:39 PM, Ali Çehreli wrote: On 02/15/2018 01:57 PM, Steven Schveighoffer wrote: > Really, i should be size_t in all places size_t or ulong? size_t would constrain 32-bit systems unless they can't handle files over 2G. The code I linked to writes to an array. So it's constrained

Re: std.zip size limit of 2 GB?

2018-02-16 Thread Ali Çehreli via Digitalmars-d-learn
On 02/15/2018 01:57 PM, Steven Schveighoffer wrote: > Really, i should be size_t in all places size_t or ulong? size_t would constrain 32-bit systems unless they can't handle files over 2G. Ali

Re: std.zip size limit of 2 GB?

2018-02-16 Thread Andre Pany via Digitalmars-d-learn
On Thursday, 15 February 2018 at 21:57:23 UTC, Steven Schveighoffer wrote: Really, i should be size_t in all places, I can't see why it should ever be int. Please file an issue. -Steve Issue created: https://issues.dlang.org/show_bug.cgi?id=18452 Thanks for the analysis. Kind regards André

Re: Faking a non-pure function as pure

2018-02-16 Thread Ali Çehreli via Digitalmars-d-learn
On 02/16/2018 09:58 AM, Nordlöw wrote: void g() pure {     static assert(!__traits(compiles, { auto x = f(42); }));     alias pureF = assumePure!(typeof());     // TODO: how do I call pureF?     // auto x = (*pureF)(42);     // auto x = pureF(42); } auto pureF = assumePure();

Faking a non-pure function as pure

2018-02-16 Thread Nordlöw via Digitalmars-d-learn
I'm struggling with my definition of assumePure that should make a non-pure function `f` callable as pure `pureF`. I've copied the definition of assumePure from the Phobos docs at https://dlang.org/phobos/std_traits.html#SetFunctionAttributes and managed to define pureF using it but I cannot

Re: static opSlice is not possible

2018-02-16 Thread Alex via Digitalmars-d-learn
On Friday, 16 February 2018 at 13:35:03 UTC, Basile B. wrote: Technically iy's a multi dimensional slicing but there's a constraint on the number of dimension allowed so that it looks exactly like a normal opSlice. By the way, i reduced too much. This shows more how it works: struct Foo {

Re: is this a bug with writeln / std.algorithm.remove?

2018-02-16 Thread arturg via Digitalmars-d-learn
On Friday, 16 February 2018 at 13:57:07 UTC, Steven Schveighoffer wrote: You have a pretty good minimal test, put that in bugzilla along with the forum thread link and all the info we know. Mark it as a dmd bug, regression, along with the version where it regressed (2.076.1), and I would tag

Re: is this a bug with writeln / std.algorithm.remove?

2018-02-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/16/18 8:51 AM, arturg wrote: On Friday, 16 February 2018 at 13:28:59 UTC, Steven Schveighoffer wrote: Strictly speaking, this is not necessarily proof that it's in phobos, there could have been changes elsewhere that cause one of the conditions to fail. However, testing this out, I

Re: is this a bug with writeln / std.algorithm.remove?

2018-02-16 Thread arturg via Digitalmars-d-learn
On Friday, 16 February 2018 at 13:28:59 UTC, Steven Schveighoffer wrote: Strictly speaking, this is not necessarily proof that it's in phobos, there could have been changes elsewhere that cause one of the conditions to fail. However, testing this out, I found something very weird. If you

Re: static opSlice is not possible

2018-02-16 Thread Basile B. via Digitalmars-d-learn
On Friday, 16 February 2018 at 13:23:09 UTC, Basile B. wrote: On Thursday, 15 February 2018 at 22:49:56 UTC, Alex wrote: Hi all, a short question about an old bug: https://issues.dlang.org/show_bug.cgi?id=11877 Are there reasons, which speaks against this feature? And maybe another one, more

Re: is this a bug with writeln / std.algorithm.remove?

2018-02-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On 2/16/18 8:16 AM, bauss wrote: On Friday, 16 February 2018 at 13:08:09 UTC, bauss wrote: On Friday, 16 February 2018 at 12:15:07 UTC, arturg wrote: On Friday, 16 February 2018 at 11:45:21 UTC, arturg wrote: this code fails to compile:     void delegate(void*) dg;     void delegate(void*)[]

Re: static opSlice is not possible

2018-02-16 Thread Basile B. via Digitalmars-d-learn
On Thursday, 15 February 2018 at 22:49:56 UTC, Alex wrote: Hi all, a short question about an old bug: https://issues.dlang.org/show_bug.cgi?id=11877 Are there reasons, which speaks against this feature? And maybe another one, more general: Is there any place, where it is documented, which

Re: is this a bug with writeln / std.algorithm.remove?

2018-02-16 Thread bauss via Digitalmars-d-learn
On Friday, 16 February 2018 at 13:08:09 UTC, bauss wrote: On Friday, 16 February 2018 at 12:15:07 UTC, arturg wrote: On Friday, 16 February 2018 at 11:45:21 UTC, arturg wrote: this code fails to compile: void delegate(void*) dg; void delegate(void*)[] dgs = [dg, dg, dg];

Re: is this a bug with writeln / std.algorithm.remove?

2018-02-16 Thread bauss via Digitalmars-d-learn
On Friday, 16 February 2018 at 12:15:07 UTC, arturg wrote: On Friday, 16 February 2018 at 11:45:21 UTC, arturg wrote: this code fails to compile: void delegate(void*) dg; void delegate(void*)[] dgs = [dg, dg, dg]; dgs.writeln; dgs.remove(1).writeln(); if you comment out

Re: is this a bug with writeln / std.algorithm.remove?

2018-02-16 Thread arturg via Digitalmars-d-learn
On Friday, 16 February 2018 at 11:45:21 UTC, arturg wrote: this code fails to compile: void delegate(void*) dg; void delegate(void*)[] dgs = [dg, dg, dg]; dgs.writeln; dgs.remove(1).writeln(); if you comment out dgs.writeln; it works as expected, it works if you use other types

is this a bug with writeln / std.algorithm.remove?

2018-02-16 Thread arturg via Digitalmars-d-learn
this code fails to compile: void delegate(void*) dg; void delegate(void*)[] dgs = [dg, dg, dg]; dgs.writeln; dgs.remove(1).writeln(); if you comment out dgs.writeln; it works as expected, it works if you use other types then void*: void delegate(int*) dg; void

Re: How to check if aggregate member is static templated method?

2018-02-16 Thread bauss via Digitalmars-d-learn
On Thursday, 15 February 2018 at 15:49:47 UTC, RazvanN wrote: On Thursday, 15 February 2018 at 13:51:41 UTC, drug wrote: 15.02.2018 16:50, drug пишет: https://run.dlang.io/is/zHT2XZ I can check againts if member is either static function or template. But I failed to check if it both static

Re: getSymbolsByUDA does not take private symbols under consideration. Should I file a bug?

2018-02-16 Thread bauss via Digitalmars-d-learn
On Friday, 16 February 2018 at 09:26:47 UTC, Piotr Mitana wrote: Hello, The code below: import std.traits; enum Attr; class MyClass { private @Attr int a; static assert(getSymbolsByUDA!(typeof(this), MyClass).length == 1); } does not compile as

Re: getSymbolsByUDA does not take private symbols under consideration. Should I file a bug?

2018-02-16 Thread Anonymouse via Digitalmars-d-learn
On Friday, 16 February 2018 at 09:26:47 UTC, Piotr Mitana wrote: Hello, The code below: import std.traits; enum Attr; class MyClass { private @Attr int a; static assert(getSymbolsByUDA!(typeof(this), MyClass).length == 1); } does not compile as

getSymbolsByUDA does not take private symbols under consideration. Should I file a bug?

2018-02-16 Thread Piotr Mitana via Digitalmars-d-learn
Hello, The code below: import std.traits; enum Attr; class MyClass { private @Attr int a; static assert(getSymbolsByUDA!(typeof(this), MyClass).length == 1); } does not compile as static assertion fails. Making the filed a public makes it compile