Re: Anyone have a Vibe.d Diet Template syntax definition for Sublime?

2019-04-21 Thread Mike Parker via Digitalmars-d-learn
On Monday, 22 April 2019 at 04:12:11 UTC, Andrej Mitrovic wrote: Or perhaps for any other editor so I could adapt it and have syntax highlighting in Sublime when viewing .dt files. Bot dls and code-d have VS Code syntax files for diet templates:

Anyone have a Vibe.d Diet Template syntax definition for Sublime?

2019-04-21 Thread Andrej Mitrovic via Digitalmars-d-learn
Or perhaps for any other editor so I could adapt it and have syntax highlighting in Sublime when viewing .dt files.

Re: Inherit enum members

2019-04-21 Thread Alex via Digitalmars-d-learn
On Sunday, 21 April 2019 at 20:58:19 UTC, Andrey wrote: Hello, I have got 2 enums. How to inherit one enum from another? enum Key : string { K1 = "qwerty", K2 = "asdfgh" } enum ExtendedKey : Key { E1 = "q1", E2 = "w2", E3 = "e3" } Result: onlineapp.d(27): Error: cannot

Re: Inherit enum members

2019-04-21 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 21 April 2019 at 20:58:19 UTC, Andrey wrote: I have got 2 enums. How to inherit one enum from another? You don't. enums don't inherit, but rather have a base type. That means each enum member must match that base type and the compiler is looser about conversions between them, but

Re: How to debug long-lived D program memory usage?

2019-04-21 Thread Patrick Schluter via Digitalmars-d-learn
On Thursday, 18 April 2019 at 12:00:10 UTC, ikod wrote: On Wednesday, 17 April 2019 at 16:27:02 UTC, Adam D. Ruppe wrote: D programs are a vital part of my home computer infrastructure. I run some 60 D processes at almost any time and have recently been running out of memory. I usually

Inherit enum members

2019-04-21 Thread Andrey via Digitalmars-d-learn
Hello, I have got 2 enums. How to inherit one enum from another? enum Key : string { K1 = "qwerty", K2 = "asdfgh" } enum ExtendedKey : Key { E1 = "q1", E2 = "w2", E3 = "e3" } Result: onlineapp.d(27): Error: cannot implicitly convert expression "q1" of type string to Key

Re: How to do operator overloading for <, >, <=, >=, !=, and == between struct and int?

2019-04-21 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Sunday, 21 April 2019 at 18:17:00 UTC, Adam D. Ruppe wrote: On Sunday, 21 April 2019 at 18:07:08 UTC, Ferhat Kurtulmuş wrote: I am writing an opencv binding and need something like: Mat m = another_mat > 5; D does not support that. The comparison operators are always just true or false

Re: How to do operator overloading for <, >, <=, >=, !=, and == between struct and int?

2019-04-21 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 21 April 2019 at 18:07:08 UTC, Ferhat Kurtulmuş wrote: I am writing an opencv binding and need something like: Mat m = another_mat > 5; D does not support that. The comparison operators are always just true or false (as determined by the int opCmp or the bool opEquals returns),

How to do operator overloading for <, >, <=, >=, !=, and == between struct and int?

2019-04-21 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
I am writing an opencv binding and need something like: Mat m = another_mat > 5; Docs does not cover this sitiuation: https://dlang.org/spec/operatoroverloading.html#compare opBinary does not support those operators, and Section "Overloading <, <=, >, and >=" describes overloaded operators

Bug with profiling GC with multiple threads/fibers

2019-04-21 Thread WebFreak001 via Digitalmars-d-learn
I'm trying to GC profile serve-d which uses a lot of fibers potentially also across some threads and some threads doing some dedicated work, however -profile=gc doesn't seem to work properly. It logs `shared static this` calls and some methods, however none of the actual stuff is in there (and

Re: Recommendations for best JSON lib?

2019-04-21 Thread Seb via Digitalmars-d-learn
On Sunday, 21 April 2019 at 02:09:29 UTC, evilrat wrote: On Saturday, 20 April 2019 at 20:44:22 UTC, Guillaume Piolat wrote: On Saturday, 20 April 2019 at 18:49:07 UTC, Nick Sabalausky (Abscissa) wrote: I only need to read arbitrary JSON data, no need for writing/(de)serialization. std.json

Re: Recommendations for best JSON lib?

2019-04-21 Thread Arjan via Digitalmars-d-learn
On Sunday, 21 April 2019 at 02:09:29 UTC, evilrat wrote: On Saturday, 20 April 2019 at 20:44:22 UTC, Guillaume Piolat wrote: On Saturday, 20 April 2019 at 18:49:07 UTC, Nick Sabalausky I also tried experimental std json, asdf and vibe.d. The only one that worked for me is vibe.d JSON

Re: Recommendations for best JSON lib?

2019-04-21 Thread Guillaume Piolat via Digitalmars-d-learn
On Sunday, 21 April 2019 at 02:09:29 UTC, evilrat wrote: On Saturday, 20 April 2019 at 20:44:22 UTC, Guillaume Piolat wrote: On Saturday, 20 April 2019 at 18:49:07 UTC, Nick Sabalausky (Abscissa) wrote: I only need to read arbitrary JSON data, no need for writing/(de)serialization. std.json

Q: docs and guides for hunt

2019-04-21 Thread ikod via Digitalmars-d-learn
Hello, I'l like to try 'hunt' project to solve one of my problems, but I can't find docs and code samples or tutorials, etc. I even can't find if hunt (or hunt-framework) can be used for my task. Please, help! Here is short descriptions what I need - long running application, periodically

Re: Unexpected behaviour in associative array

2019-04-21 Thread Arredondo via Digitalmars-d-learn
On Sunday, 21 April 2019 at 00:13:15 UTC, 9il wrote: In the latest release you can do yourSlice.lightConst.field lightConst converts from const slice to slice of const. I will add const and immutable field to the next major release. That is very good to know. BWT, I think ndslice is an