Re: Alias function declaration.

2020-05-19 Thread user1234 via Digitalmars-d-learn
On Tuesday, 19 May 2020 at 22:04:49 UTC, MaoKo wrote: Hello. I just want to find what is exactly the difference between: alias _ = void function(int); alias void _(int); Because it's seem that the latter can't be used in the declaration of an array (eg: _[] ...). I think the first is a pointer

Re: final struct ?

2020-05-19 Thread user1234 via Digitalmars-d-learn
On Tuesday, 19 May 2020 at 10:29:51 UTC, wjoe wrote: On Tuesday, 19 May 2020 at 10:08:37 UTC, user1234 wrote: On Tuesday, 19 May 2020 at 10:01:34 UTC, wjoe wrote: [...] It has no purpose. In D many attributes are allowed even if they have no meaning. D-Scanner checks this kind of stuff, to s

Re: Getting FieldNameTuple including all base-classes.

2020-05-19 Thread Paul Backus via Digitalmars-d-learn
On Tuesday, 19 May 2020 at 23:15:45 UTC, realhet wrote: Hi, I was able to reach all the fields in a subclass using foreach and BaseClassesTuple, but is there a way to do this using functional programming primitives, but in compile time for tuples? private template FieldNameTuple2(T) { enu

Re: Is it possible to write some class members in another module ?

2020-05-19 Thread Boris Carvajal via Digitalmars-d-learn
On Tuesday, 19 May 2020 at 22:01:03 UTC, Vinod K Chandran wrote: Hi all, Is it possible to write some class members in another module ? I have class with a lot of member variables.(probably 50+) I would like to write them (Not all, but some of them) in a special module for the sake of maintena

Getting FieldNameTuple including all base-classes.

2020-05-19 Thread realhet via Digitalmars-d-learn
Hi, I was able to reach all the fields in a subclass using foreach and BaseClassesTuple, but is there a way to do this using functional programming primitives, but in compile time for tuples? private template FieldNameTuple2(T) { enum FieldNameTuple2 = BaseClassesTuple!T.map!(S => FieldNam

Re: Handle FormatSpec!char in the virtual toString() method of a class.

2020-05-19 Thread realhet via Digitalmars-d-learn
On Thursday, 14 May 2020 at 19:01:25 UTC, H. S. Teoh wrote: On Wed, May 13, 2020 at 12:26:21PM +, realhet via Digitalmars-d-learn wrote: Thank You, very helpful!

Re: Is it possible to write some class members in another module ?

2020-05-19 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 19 May 2020 at 22:01:03 UTC, Vinod K Chandran wrote: Is it possible to write some class members in another module ? You can make some of members be other structs that you aggregate together.

Is it possible to write some class members in another module ?

2020-05-19 Thread Vinod K Chandran via Digitalmars-d-learn
Hi all, Is it possible to write some class members in another module ? I have class with a lot of member variables.(probably 50+) I would like to write them (Not all, but some of them) in a special module for the sake of maintenance.

Alias function declaration.

2020-05-19 Thread MaoKo via Digitalmars-d-learn
Hello. I just want to find what is exactly the difference between: alias _ = void function(int); alias void _(int); Because it's seem that the latter can't be used in the declaration of an array (eg: _[] ...). I think the first is a pointer to function and the second is a function type itself bu

Re: Why emsi containers have @disabled this(this) ?

2020-05-19 Thread Mike Parker via Digitalmars-d-learn
On Tuesday, 19 May 2020 at 20:51:01 UTC, Luis wrote: So, I'm writing my own implementation of sparse sets, and I take as reference emsi_containers for allocator usage. I saw that they have disabled postblit operator... But i don't understand exactly why. In special, when they implement InputRa

Why emsi containers have @disabled this(this) ?

2020-05-19 Thread Luis via Digitalmars-d-learn
So, I'm writing my own implementation of sparse sets, and I take as reference emsi_containers for allocator usage. I saw that they have disabled postblit operator... But i don't understand exactly why. In special, when they implement InputRange over the containers, but having disabled postblit,

Re: None of the overloads of kill are callable using argument types:

2020-05-19 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/18/20 9:18 PM, Ali Çehreli wrote: On 5/18/20 1:11 PM, BoQsc wrote:> I'm trying to kill my own process, but I'm being unsuccessful at the > compilation of the program. It seems that neither getpid nor > thisProcessID returns a correct type value for the kill function. Of course, Adam D. R

Re: DScanner warns class is undocumented, how to resolve it ?

2020-05-19 Thread Vinod K Chandran via Digitalmars-d-learn
On Thursday, 14 May 2020 at 08:02:28 UTC, Dennis wrote: On Thursday, 14 May 2020 at 06:08:17 UTC, Vinod K Chandran wrote: On Thursday, 14 May 2020 at 06:05:00 UTC, Vinod K Chandran wrote: Hi all, I wrote a class and in VS Code, DScanner says that the class is undocumented. How can i document a

Re: Compare string with German umlauts

2020-05-19 Thread Martin Tschierschke via Digitalmars-d-learn
On Monday, 18 May 2020 at 14:28:33 UTC, Steven Schveighoffer wrote: What you need is to normalize the data for comparison: https://dlang.org/phobos/std_uni.html#normalize For more reference: https://en.wikipedia.org/wiki/Combining_character -Steve I checked it again but could not reprodu

Re: final struct ?

2020-05-19 Thread wjoe via Digitalmars-d-learn
On Tuesday, 19 May 2020 at 10:08:37 UTC, user1234 wrote: On Tuesday, 19 May 2020 at 10:01:34 UTC, wjoe wrote: [...] It has no purpose. In D many attributes are allowed even if they have no meaning. D-Scanner checks this kind of stuff, to some extent, but not the compiler. Thank you.

Re: final struct ?

2020-05-19 Thread user1234 via Digitalmars-d-learn
On Tuesday, 19 May 2020 at 10:01:34 UTC, wjoe wrote: As I was reading a few source files of a library I found dozens of final struct declarations like this: final struct Foo { const pure final nothrow bar() { ... } } What's this supposed to express ? A final class is a class that can't be

final struct ?

2020-05-19 Thread wjoe via Digitalmars-d-learn
As I was reading a few source files of a library I found dozens of final struct declarations like this: final struct Foo { const pure final nothrow bar() { ... } } What's this supposed to express ? A final class is a class that can't be subclassed - structs can't be subclassed, so does th

Re: Spawn a Command Line application Window and output log information

2020-05-19 Thread BoQsc via Digitalmars-d-learn
On Monday, 18 May 2020 at 20:00:51 UTC, BoQsc wrote: I'm kind of stuck right now on how. Some more Updates and it seems that it is impossible to scroll the history of the output. import std.stdio : write, writeln, readln, writefln; import std.process : spawnShell, wait, executeShell, ki

Re: None of the overloads of kill are callable using argument types:

2020-05-19 Thread BoQsc via Digitalmars-d-learn
On Monday, 18 May 2020 at 20:40:47 UTC, Adam D. Ruppe wrote: On Monday, 18 May 2020 at 20:11:25 UTC, BoQsc wrote: I'm trying to kill my own process Don't kill yourself, just `return` from main. Returning does what I need, however I still need to get a working example on killing/terminating

Re: Compare string with German umlauts

2020-05-19 Thread Martin Tschierschke via Digitalmars-d-learn
On Monday, 18 May 2020 at 14:28:33 UTC, Steven Schveighoffer wrote: On 5/18/20 9:44 AM, Martin Tschierschke wrote: [...] using == on strings is going to compare the exact bits for equality. In unicode, things can be encoded differently to make the same grapheme. For example, ö is a code unit

Re: Compare string with German umlauts

2020-05-19 Thread Martin Tschierschke via Digitalmars-d-learn
On Monday, 18 May 2020 at 14:22:31 UTC, WebFreak001 wrote: [...] It solved the problem, but what is the right way to use umlauts (encode them) inside the program? Your code should have already worked like that, assuming your input file is a UTF-8 file. Check with an editor like Notepad++ or V

Re: D and Async I/O

2020-05-19 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2020-05-18 at 11:56 +, Sebastiaan Koppe via Digitalmars-d-learn wrote: > On Thursday, 14 May 2020 at 09:36:33 UTC, Russel Winder wrote: > > Whilst C frameworks use callbacks and trampolines, high level > > languages seem to be basing things on futures – or things that > > are effectiv