Re: Can someone explain how glfw3.dll gets created?

2014-10-14 Thread Mike Parker via Digitalmars-d-learn
On 10/14/2014 5:21 AM, WhatMeWorry wrote: I have a simple GLFW3 program running in Visual D integrated shell, that kept aborting at DerelictFLFW3.load() with a failed to load the shared libraries: glfw3.dll.' So I found a glfw3.dll somewhere and moved it into the project folder (I know this is

Re: dsource and WinAPI

2014-10-14 Thread dcrepid via Digitalmars-d-learn
Which project are you looking at? Bindings for the Windows API: http://www.dsource.org/projects/bindings/wiki/WindowsApi This is a pretty important project, especially for getting more Windows programmers on board.. thanks for your help

Re: Really in need of help with std.container.array.d

2014-10-14 Thread Nordlöw
On Monday, 13 October 2014 at 13:46:56 UTC, Robert burner Schadek wrote: other than that I'm not sure how to go about this. I tried replace inout with a C++-style member duplication at https://github.com/nordlow/phobos/commit/b2a4ca28bf25bf7c6149566d066cbb54118b36b4 Now it instead errors as

Re: Really in need of help with std.container.array.d

2014-10-14 Thread Nordlöw
On Monday, 13 October 2014 at 13:46:56 UTC, Robert burner Schadek wrote: A blunt force solution would be to create a range as Range!(ReturnType!Array...)(cast(Array!T)this, low, high); and then do the correct casts in Range. The ReturnType would be the ReturnType of opIndex of the Range type

Re: dsource and WinAPI

2014-10-14 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/14/14 5:03 AM, dcrepid wrote: Which project are you looking at? Bindings for the Windows API: http://www.dsource.org/projects/bindings/wiki/WindowsApi This is a pretty important project, especially for getting more Windows programmers on board.. thanks for your help Looks like they

When betterC triggers errors in compilation?

2014-10-14 Thread eles via Digitalmars-d-learn
Hello, According to this: http://forum.dlang.org/post/lddug4$jgv$1...@digitalmars.com -betterC should disable support for exception handling. So I expected dmd to reject the following code: === import std.stdio; int readDieFromFile() { auto

Re: When betterC triggers errors in compilation?

2014-10-14 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 14 October 2014 at 13:20:50 UTC, eles wrote: http://forum.dlang.org/post/lddug4$jgv$1...@digitalmars.com That was just a speculative thread, that stuff isn't implemented. (And I think that went way too far, IMO betterC should just remove the mandatory stuff like ModuleInfo and

Re: When betterC triggers errors in compilation?

2014-10-14 Thread ketmar via Digitalmars-d-learn
On Tue, 14 Oct 2014 13:20:49 + eles via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: What code would fail under -betterC and how? currently betterC disables module info generation and some module helper functions generation. that's all. just grep DMD sources for betterC and

Re: When betterC triggers errors in compilation?

2014-10-14 Thread eles via Digitalmars-d-learn
On Tuesday, 14 October 2014 at 13:31:47 UTC, Adam D. Ruppe wrote: On Tuesday, 14 October 2014 at 13:20:50 UTC, eles wrote: http://forum.dlang.org/post/lddug4$jgv$1...@digitalmars.com -betterC right now is still an undocumented hack that doesn't do much. Thank you.

Re: dsource and WinAPI

2014-10-14 Thread Vladimir Panteleev via Digitalmars-d-learn
On Tuesday, 14 October 2014 at 13:06:06 UTC, Steven Schveighoffer wrote: dsource is no longer actively maintained. I don't think anyone knows how to contact the admin. I've contacted Brad on a few occasions. Looks like they are still using dsource for that project, latest update is 9/7/14.

Re: Really in need of help with std.container.array.d

2014-10-14 Thread Robert burner Schadek via Digitalmars-d-learn
On Tuesday, 14 October 2014 at 12:51:29 UTC, Nordlöw wrote: Could you please give me a code example? I'm not skilled enough in D to follow this description. struct Range(T) { Array!S array; T opIndex(size_t i) { return cast(T)array[i]; } } struct Array(T) { Range!(const(T))

Re: dsource and WinAPI

2014-10-14 Thread Trass3r via Digitalmars-d-learn
the long-term solution is to include the [win32] headers in druntime ™

Re: dsource and WinAPI

2014-10-14 Thread dcrepid via Digitalmars-d-learn
Vladimir, thanks for looking at the pull request. It'd be great if the whole project was moved to GitHub to allow more people to contribute.

Re: how to get the \uxxxx unicode code from a char

2014-10-14 Thread Sean Kelly via Digitalmars-d-learn
On Tuesday, 14 October 2014 at 19:47:00 UTC, jicman wrote: Greetings. Imagine this code, char[] s = ABCabc; foreach (char c; s) { // how do I convert c to something an Unicode code? ie. \u. } I'd look at the JSON string encoder.

how to get the \uxxxx unicode code from a char

2014-10-14 Thread jicman via Digitalmars-d-learn
Greetings. Imagine this code, char[] s = ABCabc; foreach (char c; s) { // how do I convert c to something an Unicode code? ie. \u. } thanks.

Re: how to get the \uxxxx unicode code from a char

2014-10-14 Thread ketmar via Digitalmars-d-learn
On Tue, 14 Oct 2014 19:46:57 + jicman via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: char[] s = ABCabc; foreach (char c; s) { // how do I convert c to something an Unicode code? ie. \u. } string res; foreach (dchar ch; s) res ~= \\u%04X.format(ch); //

Re: how to get the \uxxxx unicode code from a char

2014-10-14 Thread jicman via Digitalmars-d-learn
On Tuesday, 14 October 2014 at 19:49:16 UTC, Sean Kelly wrote: On Tuesday, 14 October 2014 at 19:47:00 UTC, jicman wrote: Greetings. Imagine this code, char[] s = ABCabc; foreach (char c; s) { // how do I convert c to something an Unicode code? ie. \u. } I'd look at the JSON string

Re: how to get the \uxxxx unicode code from a char

2014-10-14 Thread Brad Anderson via Digitalmars-d-learn
On Tuesday, 14 October 2014 at 20:05:07 UTC, Brad Anderson wrote: https://github.com/D-Programming-Language/phobos/blob/master/std/json.d#L579 Oops. Linked the the parser section. I actually don't see any unicode escape encoder in here. Perhaps he meant the upcoming JSON module.

Re: how to get the \uxxxx unicode code from a char

2014-10-14 Thread Brad Anderson via Digitalmars-d-learn
On Tuesday, 14 October 2014 at 20:03:37 UTC, jicman wrote: On Tuesday, 14 October 2014 at 19:49:16 UTC, Sean Kelly wrote: On Tuesday, 14 October 2014 at 19:47:00 UTC, jicman wrote: Greetings. Imagine this code, char[] s = ABCabc; foreach (char c; s) { // how do I convert c to something an

Re: how to get the \uxxxx unicode code from a char

2014-10-14 Thread Brad Anderson via Digitalmars-d-learn
On Tuesday, 14 October 2014 at 20:08:03 UTC, Brad Anderson wrote: On Tuesday, 14 October 2014 at 20:05:07 UTC, Brad Anderson wrote: https://github.com/D-Programming-Language/phobos/blob/master/std/json.d#L579 Oops. Linked the the parser section. I actually don't see any unicode escape

Re: how to get the \uxxxx unicode code from a char

2014-10-14 Thread jicman via Digitalmars-d-learn
On Tuesday, 14 October 2014 at 19:56:29 UTC, ketmar via Digitalmars-d-learn wrote: On Tue, 14 Oct 2014 19:46:57 + jicman via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: char[] s = ABCabc; foreach (char c; s) { // how do I convert c to something an Unicode code? ie.

Re: how to get the \uxxxx unicode code from a char

2014-10-14 Thread jicman via Digitalmars-d-learn
On Tuesday, 14 October 2014 at 20:13:17 UTC, Brad Anderson wrote: On Tuesday, 14 October 2014 at 20:08:03 UTC, Brad Anderson wrote: On Tuesday, 14 October 2014 at 20:05:07 UTC, Brad Anderson wrote: https://github.com/D-Programming-Language/phobos/blob/master/std/json.d#L579 Oops. Linked the

Re: how to get the \uxxxx unicode code from a char

2014-10-14 Thread Ali Çehreli via Digitalmars-d-learn
On 10/14/2014 01:18 PM, jicman wrote: Thanks. This is a missing function in std.uni or std.string. josé I don't know D1 but there is std.utf.decode: http://dlang.org/phobos/std_utf.html#decode Ali

Mixin template functions are ignored in struct

2014-10-14 Thread tcak via Digitalmars-d-learn
I have written a struct and a mixin template, and that mixin template is mixed into that struct as follows. private mixin template TestCommonMethods(){ public bool apply( int d, int e ){ return false; } } public struct Test{ public mixin

Re: Mixin template functions are ignored in struct

2014-10-14 Thread anonymous via Digitalmars-d-learn
On Tuesday, 14 October 2014 at 20:58:19 UTC, tcak wrote: I have written a struct and a mixin template, and that mixin template is mixed into that struct as follows. private mixin template TestCommonMethods(){ public bool apply( int d, int e ){ return false; } }

Re: Mixin template functions are ignored in struct

2014-10-14 Thread tcak via Digitalmars-d-learn
On Tuesday, 14 October 2014 at 21:10:02 UTC, anonymous wrote: On Tuesday, 14 October 2014 at 20:58:19 UTC, tcak wrote: I have written a struct and a mixin template, and that mixin template is mixed into that struct as follows. private mixin template TestCommonMethods(){ public bool

Re: Mixin template functions are ignored in struct

2014-10-14 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 14 October 2014 at 20:58:19 UTC, tcak wrote: So, thus this mean overloading is not supported with mixin templates? Nope, what happens is mixin stuff adds items by name. If you have a variable or function in the object with the same name, it overrides the mixin one entirely.

Re: Mixin template functions are ignored in struct

2014-10-14 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 14 October 2014 at 21:21:33 UTC, tcak wrote: Anyway, that suggested usage is making my work harder. I am putting that mixin in many struct and defining each method one by one in that way doesn't seem like suitable to me. You could rename the method in the struct then mixin the

Re: Mixin template functions are ignored in struct

2014-10-14 Thread Daniel N via Digitalmars-d-learn
On Tuesday, 14 October 2014 at 20:58:19 UTC, tcak wrote: I have written a struct and a mixin template, and that mixin template is mixed into that struct as follows. Use a normal mixin + token strings(q{}). enum TestCommonMethods = q{ public bool apply( int d, int e ){

What is this ? Howw to solve it ?

2014-10-14 Thread Domingo Alvarez Duarte via Digitalmars-d-learn
With dmd trunk trying to compile vibed after fixing several array declarations from C style to D style I'm getting this error that I do not understand: --- Building vibe-d 0.7.21-rc.2 configuration libevent, build type debug. Running dmd...