Re: Output range of ranges to single buffer

2016-01-13 Thread Jacob Carlborg via Digitalmars-d-learn
On 2016-01-13 22:20, H. S. Teoh via Digitalmars-d-learn wrote: Isn't that just a matter of replacing each of the segments with their range equivalents? Also, std.format.formattedWrite will do writeln-formatting into a buffer (well, any output range, really) -- I'm pretty sure it doesn't allocate

Re: Glad and WGL

2016-01-13 Thread Josh Phillips via Digitalmars-d-learn
On Thursday, 14 January 2016 at 02:16:40 UTC, userABCabc123 wrote: On Wednesday, 13 January 2016 at 19:05:30 UTC, Josh Phillips wrote: Oh wow that's easy. They should really make that more clear in the dlang reference. They way it sounds there made me think that if a function doesn't throw any

Re: Glad and WGL

2016-01-13 Thread Josh Phillips via Digitalmars-d-learn
On Wednesday, 13 January 2016 at 20:08:55 UTC, Dav1d wrote: Link with opengl32.lib How? Everywhere I looked it says this cannot be done due to conflicting formats between the dmd compiler and the windows one.

Re: Glad and WGL

2016-01-13 Thread userABCabc123 via Digitalmars-d-learn
On Wednesday, 13 January 2016 at 19:05:30 UTC, Josh Phillips wrote: Oh wow that's easy. They should really make that more clear in the dlang reference. They way it sounds there made me think that if a function doesn't throw any errors it automatically is 'nothrow' No, because actually you can

Re: Scale-Hierarchy on ndslice

2016-01-13 Thread Ilya via Digitalmars-d-learn
On Wednesday, 13 January 2016 at 20:11:55 UTC, Timothee Cour wrote: On Wed, Jan 13, 2016 at 10:13 AM, jmh530 via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: On Tuesday, 12 January 2016 at 21:48:39 UTC, Per Nordlöw wrote: Have anybody been thinking about adding a scale-hier

Re: Anyone using glad?

2016-01-13 Thread Dav1d via Digitalmars-d-learn
On Wednesday, 13 January 2016 at 22:51:45 UTC, Jason Jeffory wrote: After an few hours of fucking with cmake, turns out it had a bug. Updated it and worked. Pretty much through with this crap. I'm not going to waste any more time screwing with the dysfunctional approach that software design is

Re: Anyone using glad?

2016-01-13 Thread Jason Jeffory via Digitalmars-d-learn
On Wednesday, 13 January 2016 at 20:13:49 UTC, Dav1d wrote: On Wednesday, 13 January 2016 at 19:20:40 UTC, Jason Jeffory wrote: What I can't seem to figure out why try { loop } catch { } catches the exception but try { loop } catch (Throwable t) // Only diff { } doesn't ;/ Probably my igno

Re: Output range of ranges to single buffer

2016-01-13 Thread Ali Çehreli via Digitalmars-d-learn
On 01/13/2016 01:20 PM, H. S. Teoh via Digitalmars-d-learn wrote: std.format.formattedWrite will do writeln-formatting into a buffer (well, any output range, really) -- I'm pretty sure it doesn't allocate, at least for the simplest cases like converting an integer. So you should be able to do so

Re: Output range of ranges to single buffer

2016-01-13 Thread Dav1d via Digitalmars-d-learn
On Wednesday, 13 January 2016 at 21:15:03 UTC, Jacob Carlborg wrote: Is it possible to somehow output a range of ranges to a single string buffer? For example, converting an array of integers to a string with the same representation as the source code. [...] std.format can do it. From the si

Re: Output range of ranges to single buffer

2016-01-13 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Jan 13, 2016 at 10:15:03PM +0100, Jacob Carlborg via Digitalmars-d-learn wrote: > Is it possible to somehow output a range of ranges to a single string > buffer? For example, converting an array of integers to a string with > the same representation as the source code. > > import std.algo

Output range of ranges to single buffer

2016-01-13 Thread Jacob Carlborg via Digitalmars-d-learn
Is it possible to somehow output a range of ranges to a single string buffer? For example, converting an array of integers to a string with the same representation as the source code. import std.algorithm; import std.conv; import std.string; void main() { auto a = [1, 2, 3, 4, 5]; auto

Re: Anyone using glad?

2016-01-13 Thread Dav1d via Digitalmars-d-learn
On Wednesday, 13 January 2016 at 19:20:40 UTC, Jason Jeffory wrote: What I can't seem to figure out why try { loop } catch { } catches the exception but try { loop } catch (Throwable t) // Only diff { } doesn't ;/ Probably my ignorance about D, but I was hoping to get some info about the e

Re: Scale-Hierarchy on ndslice

2016-01-13 Thread Timothee Cour via Digitalmars-d-learn
On Wed, Jan 13, 2016 at 10:13 AM, jmh530 via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: > On Tuesday, 12 January 2016 at 21:48:39 UTC, Per Nordlöw wrote: > >> Have anybody been thinking about adding a scale-hierarchy structure on >> top of ndslice? >> > > What is a scale-hiera

Re: Glad and WGL

2016-01-13 Thread Dav1d via Digitalmars-d-learn
On Wednesday, 13 January 2016 at 19:05:30 UTC, Josh Phillips wrote: On Wednesday, 13 January 2016 at 18:37:09 UTC, Adam D. Ruppe wrote: [...] Oh wow that's easy. They should really make that more clear in the dlang reference. They way it sounds there made me think that if a function doesn't

Re: Linking a DLL to a DLL with packages

2016-01-13 Thread Thalamus via Digitalmars-d-learn
On Sunday, 10 January 2016 at 15:58:55 UTC, Benjamin Thaut wrote: Am 09.01.2016 um 16:45 schrieb Thalamus: Hi Benjamin, I wouldn't say I need DLLs to work fully _really_ badly. The only non-negligible issue with single very large binaries that's crossed my mind is patching, but we're years a

Re: Anyone using glad?

2016-01-13 Thread Jason Jeffory via Digitalmars-d-learn
What I can't seem to figure out why try { loop } catch { } catches the exception but try { loop } catch (Throwable t) // Only diff { } doesn't ;/ Probably my ignorance about D, but I was hoping to get some info about the exception this way(line number, etc...)

Re: Anyone using glad?

2016-01-13 Thread Jason Jeffory via Digitalmars-d-learn
On Wednesday, 13 January 2016 at 18:40:39 UTC, Dav1d wrote: On Wednesday, 13 January 2016 at 17:43:54 UTC, Jason Jeffory wrote: On Wednesday, 13 January 2016 at 16:04:32 UTC, Dav1d wrote: On Wednesday, 13 January 2016 at 06:30:44 UTC, Jason Jeffory wrote: [...] That's not correct. Build a de

Re: Glad and WGL

2016-01-13 Thread Josh Phillips via Digitalmars-d-learn
On Wednesday, 13 January 2016 at 18:37:09 UTC, Adam D. Ruppe wrote: You just need to explicitly mark it nothrow in the signature. Add `nothrow` to the end of the param list: extern(Windows) LRESULT WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) nothrow and then you'll be cool

Re: Compiler complaining about ~ used on static array in @nogc fn

2016-01-13 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Jan 13, 2016 at 10:23:17PM +0530, Shriramana Sharma via Digitalmars-d-learn wrote: > Referring to: > https://auto-tester.puremagic.com/show-run.ghtml?projectid=1&runid=1915054&isPull=true, > the lines in question are > phobos/std/utf.d (66, 67): > > UnsignedStringBuf buf = void

Re: Anyone using glad?

2016-01-13 Thread Dav1d via Digitalmars-d-learn
On Wednesday, 13 January 2016 at 17:43:54 UTC, Jason Jeffory wrote: On Wednesday, 13 January 2016 at 16:04:32 UTC, Dav1d wrote: On Wednesday, 13 January 2016 at 06:30:44 UTC, Jason Jeffory wrote: [...] That's not correct. Build a debug build and check the stacktrace which should be printed,

Re: Scale-Hierarchy on ndslice

2016-01-13 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Wednesday, 13 January 2016 at 18:09:06 UTC, Per Nordlöw wrote: On Wednesday, 13 January 2016 at 08:31:58 UTC, Ilya Yaroshenko wrote: If you describe additional required features for ndslice, I will think how they can be implemented in the Mir/Phobos. --Ilya Ok, great. BTW: What is Mir? h

Re: Glad and WGL

2016-01-13 Thread Dav1d via Digitalmars-d-learn
On Wednesday, 13 January 2016 at 18:34:14 UTC, Josh Phillips wrote: So I started using Glad but I can't get WGL to work with it, though I think this is more of a Win32 issue than WGL. wndclass.lpfnWndProc = &WndProc; Gives me an error no matter what: Error: cannot implicitly convert expressi

Re: Glad and WGL

2016-01-13 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 13 January 2016 at 18:34:14 UTC, Josh Phillips wrote: extern(Windows) LRESULT WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) You just need to explicitly mark it nothrow in the signature. Add `nothrow` to the end of the param list: extern(Windows) LRESULT WndPro

Glad and WGL

2016-01-13 Thread Josh Phillips via Digitalmars-d-learn
So I started using Glad but I can't get WGL to work with it, though I think this is more of a Win32 issue than WGL. wndclass.lpfnWndProc = &WndProc; Gives me an error no matter what: Error: cannot implicitly convert expression (& WndProc) of type int function(void* hWnd, uint message, uint w

Re: Scale-Hierarchy on ndslice

2016-01-13 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 12 January 2016 at 21:48:39 UTC, Per Nordlöw wrote: Have anybody been thinking about adding a scale-hierarchy structure on top of ndslice? What is a scale-hierarchy structure?

Re: Scale-Hierarchy on ndslice

2016-01-13 Thread Per Nordlöw via Digitalmars-d-learn
On Wednesday, 13 January 2016 at 08:31:58 UTC, Ilya Yaroshenko wrote: If you describe additional required features for ndslice, I will think how they can be implemented in the Mir/Phobos. --Ilya Ok, great. BTW: What is Mir?

Re: Anyone using glad?

2016-01-13 Thread Jason Jeffory via Digitalmars-d-learn
On Wednesday, 13 January 2016 at 16:04:32 UTC, Dav1d wrote: On Wednesday, 13 January 2016 at 06:30:44 UTC, Jason Jeffory wrote: On Tuesday, 12 January 2016 at 20:48:37 UTC, Dav1d wrote: On Tuesday, 12 January 2016 at 19:16:51 UTC, Jason Jeffory wrote: [...] Yup, that's a little bit annoying

Compiler complaining about ~ used on static array in @nogc fn

2016-01-13 Thread Shriramana Sharma via Digitalmars-d-learn
Referring to: https://auto-tester.puremagic.com/show-run.ghtml?projectid=1&runid=1915054&isPull=true, the lines in question are phobos/std/utf.d (66, 67): UnsignedStringBuf buf = void; msg ~= " (at index " ~ unsignedToTempString(index, buf, 10) ~ ")"; rgrepping through the drun

Re: Anyone using glad?

2016-01-13 Thread Dav1d via Digitalmars-d-learn
On Wednesday, 13 January 2016 at 06:30:44 UTC, Jason Jeffory wrote: On Tuesday, 12 January 2016 at 20:48:37 UTC, Dav1d wrote: On Tuesday, 12 January 2016 at 19:16:51 UTC, Jason Jeffory wrote: [...] Yup, that's a little bit annoying on Windows (also as mentioned before the deimos bindings wer

Re: mixed-in ctor not on par with explicit one?

2016-01-13 Thread Shriramana Sharma via Digitalmars-d-learn
Jacob Carlborg wrote: > Looks like a limitation in the language. Apparently already reported as well: https://issues.dlang.org/show_bug.cgi?id=11500 -- Shriramana Sharma, Penguin #395953

Re: mixed-in ctor not on par with explicit one?

2016-01-13 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 13 January 2016 at 13:53:01 UTC, Daniel N wrote: This works: Indeed... but interestingly, it does not work if you define the mixin before the new constructor: struct Test { mixin myCtors mixed; alias __ctor = mixed.__ctor; this(string s) {} } l.d(10): Error

Re: mixed-in ctor not on par with explicit one?

2016-01-13 Thread Daniel N via Digitalmars-d-learn
On Wednesday, 13 January 2016 at 12:39:36 UTC, Jacob Carlborg wrote: On 2016-01-13 10:48, Shriramana Sharma wrote: This is not what alias <> this is supposed to do, right? No. So how am I supposed to get the mixed in ctors work? Looks like a limitation in the language. This works: mixi

Re: mixed-in ctor not on par with explicit one?

2016-01-13 Thread Jacob Carlborg via Digitalmars-d-learn
On 2016-01-13 10:48, Shriramana Sharma wrote: This is not what alias <> this is supposed to do, right? No. So how am I supposed to get the mixed in ctors work? Looks like a limitation in the language. -- /Jacob Carlborg

Re: mixed-in ctor not on par with explicit one?

2016-01-13 Thread Shriramana Sharma via Digitalmars-d-learn
Hello and thanks for your reply. Jacob Carlborg wrote: > [1] http://dlang.org/spec/template-mixin.html - search for "Alias > declarations can be used to overload together functions declared in > different mixins" But I'm not able to do that with `this`: mixin template myCtors() { this(int i

Re: mixed-in ctor not on par with explicit one?

2016-01-13 Thread Jacob Carlborg via Digitalmars-d-learn
On 2016-01-13 04:32, Shriramana Sharma wrote: Hello. Compiling the following code: mixin template intCtor() { this(int i) {} } struct Test { mixin intCtor; this(string s) {} } void main() { auto a = Test("hello"); auto b = Test(1); } ...gives the error: (6): Error: constructor .Test.

Re: Declaring extern(C) declarations with template mixins

2016-01-13 Thread Jacob Carlborg via Digitalmars-d-learn
On 2016-01-12 22:27, Mathias Lang wrote: https://issues.dlang.org/show_bug.cgi?id=12575 Thanks. -- /Jacob Carlborg

Re: Scale-Hierarchy on ndslice

2016-01-13 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Tuesday, 12 January 2016 at 21:48:39 UTC, Per Nordlöw wrote: Have anybody been thinking about adding a scale-hierarchy structure on top of ndslice? I need this to implementing some cool signal/image processing algorithms in D. When processing an image this structure is called a Mipmap.

Re: cast fails for classes from windows dll

2016-01-13 Thread Benjamin Thaut via Digitalmars-d-learn
On Tuesday, 12 January 2016 at 19:00:26 UTC, Andre wrote: Hi, I am not sure, whether this is a current limitation of the windows dll functionality of D or I am doing s.th. which will not work. I have developed in D a windows DLL which creates class instances by passing the name (using object