Re: profiling issues

2014-09-12 Thread Vlad Levenfeld via Digitalmars-d-learn
Awesome! These are exactly what I was looking for. Thanks!

Re: Is º an unicode alphabetic character?

2014-09-12 Thread AsmMan via Digitalmars-d-learn
On Friday, 12 September 2014 at 04:04:22 UTC, Ali Çehreli wrote: On 09/11/2014 08:04 PM, AsmMan wrote: what's an unicode alphabetic character? Alphabetic is defined as Lu + Ll + Lt + Lm + Lo + Nl + Other_Alphabetic, all of which are explained here:

Re: Idiomatic async programming like C# async/await

2014-09-12 Thread Kagamin via Digitalmars-d-learn
async/await is not so much about futures/promises, but optimization of IO-bound operations, i.e. when you wait on network/disk, you don't consume stack, threads and similar resources, an analog in D is vibe.d

Re: Is º an unicode alphabetic character?

2014-09-12 Thread Ali Çehreli via Digitalmars-d-learn
On 09/11/2014 11:38 PM, AsmMan wrote: If I want ASCII and latin only alphabet which range should I use? ie, how should I rewrite is_id() function? This seems to be it: import std.stdio; import std.uni; void main() { alias latin = unicode.script.latin; assert('ç' in latin);

Re: std.range.byLine

2014-09-12 Thread Nordlöw
On Thursday, 11 September 2014 at 22:39:40 UTC, H. S. Teoh via Digitalmars-d-learn Why not just use std.regex? foreach (line; myInput.split(regex(`\n|\r\n|\r`))) { ... } T I'll try the lazy variant of std.regex foreach (line;

Re: std.range.byLine

2014-09-12 Thread Nordlöw
On Thursday, 11 September 2014 at 22:39:40 UTC, H. S. Teoh via Digitalmars-d-learn wrote: foreach (line; myInput.split(regex(`\n|\r\n|\r`))) Shouldn't you use foreach (line; myInput.split(regex(\n|\r\n|\r))) here?

Extremely funny behavior .. could be a bug?

2014-09-12 Thread seany via Digitalmars-d-learn
consider the following : in file a.d module a; class class_a { struct RESULT{ string[] raw; void* res; } RESULT r; void dothing() { r = new RESULT; string aa = string; r.raw ~= aa; r.res = cast(void*) aa; } } in file b.d import a;// import path is okey

Re: std.range.byLine

2014-09-12 Thread monarch_dodra via Digitalmars-d-learn
On Friday, 12 September 2014 at 13:25:22 UTC, Nordlöw wrote: On Thursday, 11 September 2014 at 22:39:40 UTC, H. S. Teoh via Digitalmars-d-learn wrote: foreach (line; myInput.split(regex(`\n|\r\n|\r`))) Shouldn't you use foreach (line; myInput.split(regex(\n|\r\n|\r))) here?

Re: Extremely funny behavior .. could be a bug?

2014-09-12 Thread Ali Çehreli via Digitalmars-d-learn
There are multiple problems with the code. Is that really what you are using? On 09/12/2014 06:35 AM, seany wrote: consider the following : in file a.d module a; class class_a { struct RESULT{ string[] raw; void* res; } RESULT r; void dothing() { r = new RESULT;

Re: Idiomatic async programming like C# async/await

2014-09-12 Thread Cliff via Digitalmars-d-learn
On Friday, 12 September 2014 at 07:15:33 UTC, Kagamin wrote: async/await is not so much about futures/promises, but optimization of IO-bound operations, i.e. when you wait on network/disk, you don't consume stack, threads and similar resources, an analog in D is vibe.d I should have been

Re: Extremely funny behavior .. could be a bug?

2014-09-12 Thread seany via Digitalmars-d-learn
On Friday, 12 September 2014 at 15:26:34 UTC, Ali Çehreli wrote: you are right, it was a reduced form, of a very complex software. in file a.d module a; class class_a { struct RESULT{ string[] raw; void* res; } RESULT * r; void dothing() { r = new RESULT; string aa =

Re: std.range.byLine

2014-09-12 Thread Nordlöw
On Friday, 12 September 2014 at 14:16:07 UTC, monarch_dodra wrote: Probably not, as (AFAIK) the splitter engine *itself* will *also* escape the passed in characters. IE: It literally needs the characters '\' and 'n'. I ended up with this.

Re: Extremely funny behavior .. could be a bug?

2014-09-12 Thread Ali Çehreli via Digitalmars-d-learn
On 09/12/2014 12:16 PM, seany wrote: On Friday, 12 September 2014 at 15:26:34 UTC, Ali Çehreli wrote: you are right, it was a reduced form, of a very complex software. Maybe others can figure it out by reading the code but a working code that reproduces the problem is very important for

Re: DUB Dependency Tree Configuration Error

2014-09-12 Thread Nordlöw
On Thursday, 11 September 2014 at 09:55:05 UTC, Nordlöw wrote: On Thursday, 11 September 2014 at 09:53:34 UTC, Nordlöw wrote: I've tried removing ~/.dub/packages with no progres. I'm using dub git master. See https://github.com/D-Programming-Language/dub/issues/418 for an explanation.

Should dmd have given me a warning at least?

2014-09-12 Thread WhatMeWorry via Digitalmars-d-learn
// the following two lines compile cleanly but when executed, I get // D:\Projects\Derelict02_SimpleOpenGL_3_3_program.exe // object.Error: Access Violation // string glShadingLangVer = to!string(glGetString(GL_SHADING_LANGUAGE_VERSION)); writeln(glShadingLangVer is ,

Re: Should dmd have given me a warning at least?

2014-09-12 Thread Ali Çehreli via Digitalmars-d-learn
On 09/12/2014 03:44 PM, WhatMeWorry wrote: // the following two lines compile cleanly but when executed, I get // D:\Projects\Derelict02_SimpleOpenGL_3_3_program.exe // object.Error: Access Violation // string glShadingLangVer =

Re: Is º an unicode alphabetic character?

2014-09-12 Thread AsmMan via Digitalmars-d-learn
On Friday, 12 September 2014 at 07:57:43 UTC, Ali Çehreli wrote: On 09/11/2014 11:38 PM, AsmMan wrote: If I want ASCII and latin only alphabet which range should I use? ie, how should I rewrite is_id() function? This seems to be it: import std.stdio; import std.uni; void main() { alias

Re: Is º an unicode alphabetic character?

2014-09-12 Thread AsmMan via Digitalmars-d-learn
Thanks Ali, I think I get close: bool is_id(dchar c) { return c = 'a' c = 'z' || c = 'A' c = 'Z' || c = 0xc0 c = 0x0d || c = 0xd8 c = 0xf6 || c = 0xf8 c = 0xff; } this doesn't include some math symbols. like c = 0xc0 did.

Re: Should dmd have given me a warning at least?

2014-09-12 Thread WhatMeWorry via Digitalmars-d-learn
On Friday, 12 September 2014 at 22:53:35 UTC, Ali Çehreli wrote: On 09/12/2014 03:44 PM, WhatMeWorry wrote: // the following two lines compile cleanly but when executed, I get // D:\Projects\Derelict02_SimpleOpenGL_3_3_program.exe // object.Error: Access Violation // string

Re: Should dmd have given me a warning at least?

2014-09-12 Thread Ali Çehreli via Digitalmars-d-learn
On 09/12/2014 05:52 PM, WhatMeWorry wrote: Isn't this a contradiction. The documentation says glGetString returns a pointer to a static string... They are talking about a C string, which is normally a 'char*' (their API returns 'GLubyte*' but it doesn't matter here). But further on down