Re: dip1000 rule 5

2018-11-25 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 25 November 2018 at 21:22:09 UTC, sclytrack wrote: Did DIP1000 go through any review process? I'm seeing it is a draft. The previous DIP manager marked DIPs as Draft while they were under review. I don't use that anymore. I left DIP1000 untouched after I took over, however.

Re: D is supposed to compile fast.

2018-11-25 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 25 November 2018 at 22:00:21 UTC, Chris Katko wrote: So 1) I have to compile manually, then link. Except that also runs the files every time even if they're up-to-date. Is that normal behavior for C/C++? Yes, C and C++ compilers behave the same way. #1 How to I only build

Re: D Language 2.1

2018-11-25 Thread Neia Neutuladh via Digitalmars-d-learn
On Sun, 25 Nov 2018 20:46:28 +, Tony wrote: > From std.compiler.D_major and std.compiler.D_minor I see that my D > language version is at 2.0 . But the version of gdc front-end I am using > (via Debian default gdc package as of a few months ago) from > std.compiler.version_major and

Re: Convert multibyte `string` to `dstring`

2018-11-25 Thread Vladimirs Nordholm via Digitalmars-d-learn
On Sunday, 25 November 2018 at 21:33:15 UTC, Stanislav Blinov wrote: On Sunday, 25 November 2018 at 21:23:31 UTC, Vladimirs Nordholm wrote: Is there a proper way to convert a string with multibyte characters into a dstring? void main() { import std.conv : to; import std.stdio :

Re: D is supposed to compile fast.

2018-11-25 Thread Tony via Digitalmars-d-learn
On Sunday, 25 November 2018 at 22:00:21 UTC, Chris Katko wrote: On Saturday, 24 November 2018 at 20:44:57 UTC, welkam wrote: On Friday, 23 November 2018 at 08:57:57 UTC, Chris Katko wrote: D is supposed to compile fast. You didnt read the fine print. It compiles simple code fast. Also

Re: D is supposed to compile fast.

2018-11-25 Thread Chris Katko via Digitalmars-d-learn
On Saturday, 24 November 2018 at 20:44:57 UTC, welkam wrote: On Friday, 23 November 2018 at 08:57:57 UTC, Chris Katko wrote: D is supposed to compile fast. You didnt read the fine print. It compiles simple code fast. Also compilation is separate step from linking and your program might

Re: version(StdDoc)

2018-11-25 Thread Stanislav Blinov via Digitalmars-d-learn
On Sunday, 25 November 2018 at 21:38:43 UTC, H. S. Teoh wrote: Actually, I just thought of a way to do this with the existing language: use a struct to simulate an enum: struct E { alias Basetype = int; Basetype impl; alias impl this;

Re: version(StdDoc)

2018-11-25 Thread H. S. Teoh via Digitalmars-d-learn
On Sun, Nov 25, 2018 at 07:22:54AM +, Stanislav Blinov via Digitalmars-d-learn wrote: > On Sunday, 25 November 2018 at 07:19:50 UTC, Stanislav Blinov wrote: > > > Granted, it may require some special syntax, i.e. > > > > enum E { > > a, > > b if version(Windows), > > c if

Re: dip1000 rule 5

2018-11-25 Thread Stanislav Blinov via Digitalmars-d-learn
On Sunday, 25 November 2018 at 21:22:09 UTC, sclytrack wrote: Did DIP1000 go through any review process? I'm seeing it is a draft. Review links are at the very end. https://github.com/dlang/DIPs/blob/master/PROCEDURE.md Keeps talking about a Drafts subdirectory. I don't see any directory

Re: version(StdDoc)

2018-11-25 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, November 24, 2018 10:41:56 PM MST H. S. Teoh via Digitalmars-d- learn wrote: > On Sat, Nov 24, 2018 at 05:48:16PM +, Stanislav Blinov via Digitalmars-d-learn wrote: > > On Saturday, 24 November 2018 at 17:43:35 UTC, Jonathan M Davis wrote: > > > I'm still inclined to think though

Re: Convert multibyte `string` to `dstring`

2018-11-25 Thread Stanislav Blinov via Digitalmars-d-learn
On Sunday, 25 November 2018 at 21:23:31 UTC, Vladimirs Nordholm wrote: Is there a proper way to convert a string with multibyte characters into a dstring? void main() { import std.conv : to; import std.stdio : writeln; string a = "abc123"; auto b = to!dstring(a);

Convert multibyte `string` to `dstring`

2018-11-25 Thread Vladimirs Nordholm via Digitalmars-d-learn
Hello. Is there a proper way to convert a string with multibyte characters into a dstring? Case scenario: string a = "abc123"; // a.length == 10 ("abc"==3 + ""==4 + "123"==3) dstring b = foo(a); // b.length = 7 ("abc"==3 + ""==1 + "123"==3) dstring foo(string str) {

Re: dip1000 rule 5

2018-11-25 Thread sclytrack via Digitalmars-d-learn
On Sunday, 25 November 2018 at 19:49:03 UTC, Stanislav Blinov wrote: On Sunday, 25 November 2018 at 19:22:36 UTC, sclytrack wrote: There are 4 rules listed. ... What is rule 5? ... Wouldn't you call it D3 because of the name mangling of DIP1000 once activated by default? That "rule 5" looks

D Language 2.1

2018-11-25 Thread Tony via Digitalmars-d-learn
From std.compiler.D_major and std.compiler.D_minor I see that my D language version is at 2.0 . But the version of gdc front-end I am using (via Debian default gdc package as of a few months ago) from std.compiler.version_major and std.compiler.version_minor is at 2.68 . That is a lot of bug

Re: dip1000 rule 5

2018-11-25 Thread Stanislav Blinov via Digitalmars-d-learn
On Sunday, 25 November 2018 at 19:22:36 UTC, sclytrack wrote: There are 4 rules listed. ... What is rule 5? ... Wouldn't you call it D3 because of the name mangling of DIP1000 once activated by default? That "rule 5" looks like a straight up mistake. As for D3... IMHO, no, not by a long

dip1000 rule 5

2018-11-25 Thread sclytrack via Digitalmars-d-learn
There are 4 rules listed. https://github.com/dlang/DIPs/blob/master/DIPs/DIP1000.md What is rule 5? int* global_ptr; void abc() { scope int* a; int* b; scope int* c = a; // Error, rule 5 scope int* d = b; // Ok int* i = a;// Ok, scope is inferred

[Pegged] making parsing error informative

2018-11-25 Thread drug via Digitalmars-d-learn
I have the following grammar https://run.dlang.io/is/gRTGm3 If user types `ubyte1` instead of `ubyte` the whole string parsing fails and error message says string is wrong from the start. How can I get more informative message like "unknown type ubyte1" or at least error position points to

Re: How to get all modules in a package at CT?

2018-11-25 Thread Andre Pany via Digitalmars-d-learn
On Saturday, 24 November 2018 at 08:44:19 UTC, Domain wrote: I have a package named command, and many modules inside it, such as command.build, command.pack, command.help... I want to get all these modules at compile time so that I know what command is available. As far as I understand there