Re: Delegates and classes for custom code.

2018-04-16 Thread Nathan S. via Digitalmars-d-learn
On Tuesday, 17 April 2018 at 04:09:57 UTC, Chris Katko wrote: I'm having trouble conceptualizing this issue at the moment. But it seems if I pass to the delegate my object, then I can ONLY use one class type. Can you post the code you're trying to run?

Re: Delegates and classes for custom code.

2018-04-16 Thread Chris Katko via Digitalmars-d-learn
I'm having trouble conceptualizing this issue at the moment. But it seems if I pass to the delegate my object, then I can ONLY use one class type. Say, the delegate takes a "this" from... some class that wants to have a dialog. A window. Now the delegate NEEDS a this from a window, and only a

Re: Delegates and classes for custom code.

2018-04-16 Thread Chris Katko via Digitalmars-d-learn
Some typos in there. execute == on_draw. Basically, I'm just sending a delegate/lambda "custom function" at initialization time. But I'd like that delegate to somehow access the holding classes functions. Or figure out how to do that. Maybe the class somehow sends the delegate a this parame

Delegates and classes for custom code.

2018-04-16 Thread Chris Katko via Digitalmars-d-learn
What I want: class viewport_t { int x,y,w,h; } class dialog_t { int x,y; this( int x, int y, delegate void (viewport_t) on_draw ) { this.x = x; this.y = y; this.execute = execute; } void draw_text(string text) { } delegate void (viewport_t) on_draw;

Re: Error calling geqrs function from lubeck package.

2018-04-16 Thread Jamie via Digitalmars-d-learn
On Tuesday, 17 April 2018 at 03:26:25 UTC, Jamie wrote: Sorry it's really an error calling geqrs function from mir-lapack package.

Error calling geqrs function from lubeck package.

2018-04-16 Thread Jamie via Digitalmars-d-learn
I'm attempting to use the lubeck package, as described here https://forum.dlang.org/post/axacgiisczwvygyef...@forum.dlang.org I have lubeck, mir-algorithm, mir-blas, mir-lapack downloaded and accessible by the compiler, and I have installed liblapack-dev and libblas-dev. When I attempt to ru

Re: making a struct an inputRange with free functions

2018-04-16 Thread Johannes Loher via Digitalmars-d-learn
Am 16.04.2018 um 21:27 schrieb Jonathan M Davis: > On Monday, April 16, 2018 21:10:03 Johannes Loher via Digitalmars-d-learn > wrote: >> Is there a way to do this? Here is a naive implementation: >> https://run.dlang.io/is/JKvL80 . >> >> It does not pass `isInputRange` (I think, because the free f

Re: making a struct an inputRange with free functions

2018-04-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/16/18 3:10 PM, Johannes Loher wrote: Is there a way to do this? Here is a naive implementation: https://run.dlang.io/is/JKvL80 . It does not pass `isInputRange` (I think, because the free functions are not visible in the scope of `isInputRange`). You are correct, it's not possible. Tryi

Re: making a struct an inputRange with free functions

2018-04-16 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, April 16, 2018 21:10:03 Johannes Loher via Digitalmars-d-learn wrote: > Is there a way to do this? Here is a naive implementation: > https://run.dlang.io/is/JKvL80 . > > It does not pass `isInputRange` (I think, because the free functions are > not visible in the scope of `isInputRange`

making a struct an inputRange with free functions

2018-04-16 Thread Johannes Loher via Digitalmars-d-learn
Is there a way to do this? Here is a naive implementation: https://run.dlang.io/is/JKvL80 . It does not pass `isInputRange` (I think, because the free functions are not visible in the scope of `isInputRange`). Trying to iterate over it with a foreach loop results in a compile error: Error: invali

Re: why use string for this example of appender?

2018-04-16 Thread WhatMeWorry via Digitalmars-d-learn
Thanks all. I sometimes feel like Michael Corleone: "Just when I thought I was out, they pull me back in!" :) I realize it is not the place for it, but sometimes I wish the Library Reference explained things in terms of "why".

Re: How/where to hack DMD to generate docs for string mixed members.

2018-04-16 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, April 16, 2018 16:05:40 9il via Digitalmars-d-learn wrote: > On Sunday, 15 April 2018 at 08:17:21 UTC, Jonathan M Davis wrote: > > On Sunday, April 15, 2018 07:59:17 Stefan Koch via > > > > Digitalmars-d-learn wrote: > >> On Sunday, 15 April 2018 at 05:20:31 UTC, 9il wrote: > >> > Hey, >

Re: How/where to hack DMD to generate docs for string mixed members.

2018-04-16 Thread 9il via Digitalmars-d-learn
On Sunday, 15 April 2018 at 08:17:21 UTC, Jonathan M Davis wrote: On Sunday, April 15, 2018 07:59:17 Stefan Koch via Digitalmars-d-learn wrote: On Sunday, 15 April 2018 at 05:20:31 UTC, 9il wrote: > Hey, > > How/where to hack DMD to generate docs for string mixed > members? > > struct S > { >

Re: How/where to hack DMD to generate docs for string mixed members.

2018-04-16 Thread 9il via Digitalmars-d-learn
On Sunday, 15 April 2018 at 07:59:17 UTC, Stefan Koch wrote: On Sunday, 15 April 2018 at 05:20:31 UTC, 9il wrote: Hey, How/where to hack DMD to generate docs for string mixed members? struct S { mixin(" /// auto bar() {} "); } Best regards, Ilya Yaroshenko hmm you should

Re: why use string for this example of appender?

2018-04-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On 4/16/18 4:49 AM, Ali Çehreli wrote: On 04/15/2018 11:46 PM, WhatMeForget wrote: > > I think I got a handle on D's static and dynamic arrays, till I come to > std.array and see all the shiny new tools. I can understand all the > replace.. functions, but the appender function gave me pause.

Re: why use string for this example of appender?

2018-04-16 Thread Boris-Barboris via Digitalmars-d-learn
On Monday, 16 April 2018 at 06:46:36 UTC, WhatMeForget wrote: Another thing that had me wondering is the use of put() down below; doesn't the append syntax (~=) give you the same exact functionality; so why bother? Appender also performs unicode-related conversions, so you can append dstring

Re: why use string for this example of appender?

2018-04-16 Thread Ali Çehreli via Digitalmars-d-learn
On 04/15/2018 11:46 PM, WhatMeForget wrote: > > I think I got a handle on D's static and dynamic arrays, till I come to > std.array and see all the shiny new tools. I can understand all the > replace.. functions, but the appender function gave me pause. The > documentation says appender "Returns a