Re: Count template parameters of method

2020-10-12 Thread Andrey via Digitalmars-d-learn
And what about: void test() {} and void text(alias qqq)() {} ?

Re: Can I measure how much memory is used in total, grouped by type?

2020-10-12 Thread drathier via Digitalmars-d-learn
On Sunday, 11 October 2020 at 20:58:22 UTC, drathier wrote: I think I'm using way to much memory for pointers, so I'd like to see how much of my memory usage is taken up by pointers. I've calculated the answer, but I wonder if the compiler/runtime could do it for me, to get a faster and more

Re: Win32Api GetDlgItemText How make buffer with no fixed size?

2020-10-12 Thread Marcone via Digitalmars-d-learn
On Saturday, 10 October 2020 at 12:31:14 UTC, Adam D. Ruppe wrote: On Saturday, 10 October 2020 at 10:15:03 UTC, Marcone wrote: wchar[100] buffer; // I don't want fixed size :( wchar[] buffer; // no fixed size buffer.length = GetWindowTextLength(hwn); // set it to the text length of the

Re: Renaming Flag!"" in API

2020-10-12 Thread Steven Schveighoffer via Digitalmars-d-learn
On 10/12/20 7:34 AM, Vladimir Panteleev wrote: On Monday, 12 October 2020 at 10:24:44 UTC, FreeSlave wrote: Can this issue overcome somehow? Why not add a deprecated overload for your function which takes the old Flag value? Or even not deprecated (if it still makes sense). -Steve

Re: Renaming Flag!"" in API

2020-10-12 Thread FreeSlave via Digitalmars-d-learn
On Monday, 12 October 2020 at 11:34:25 UTC, Vladimir Panteleev wrote: On Monday, 12 October 2020 at 10:24:44 UTC, FreeSlave wrote: Can this issue overcome somehow? Why not add a deprecated overload for your function which takes the old Flag value? I thought about overloading too.

Re: vibe.d / experience / feedback

2020-10-12 Thread Robert M . Münch via Digitalmars-d-learn
On 11 Oct 2020 at 21:10:20 CEST, "tastyminerals" wrote: > And I feel like you guys will just pick Go because it will get > stuff done. That's the main focus from a company perspective. We try to waste as less time & money as possible. > When I just started learning about D ecosystem, vibe

Renaming Flag!"" in API

2020-10-12 Thread FreeSlave via Digitalmars-d-learn
Let's say I use Flag type named 'myflagname' in API like this: import std.typecons; void func(Flag!"myflagname" flag) { //... } void main() { func(Yes.myflagname); } Later I realize that 'myflagname' is a bad name and I want to change it to something else. But if I do so, I break the

Re: Range format specifiers in other languages?

2020-10-12 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Oct 12, 2020 at 05:51:21AM +, Imperatorn via Digitalmars-d-learn wrote: > On Monday, 12 October 2020 at 00:59:33 UTC, Adam D. Ruppe wrote: > > On Monday, 12 October 2020 at 00:46:37 UTC, Imperatorn wrote: > > > To people trying to learn, why is that % before ( needed in the > > >

Re: vibe.d / experience / feedback

2020-10-12 Thread Robert M . Münch via Digitalmars-d-learn
On 12 Oct 2020 at 13:13:27 CEST, "Ola Fosheim Grøstad" wrote: > Yes, it is a good fit for web services with medium sized code > bases. We don't have a lot of "big project" experience with Go yet, but we would use it for a plain-old desktop application. Even most people seem to use Go for the

Re: Wanted! Tree Node implementation.

2020-10-12 Thread Jan Hönig via Digitalmars-d-learn
On Wednesday, 7 October 2020 at 14:31:20 UTC, Виталий Фадеев wrote: Wanted! Tree Node implementation. Like a: mixin template TreeNode( T ) { T parent; T firstChild; T lastChild; T prevSibling; T nextSibling; // ForwardRange implementation @property T front() { ...

Re: List of exceptions?

2020-10-12 Thread DMon via Digitalmars-d-learn
On Monday, 12 October 2020 at 09:11:35 UTC, Dominikus Dittes Scherkl wrote: - ...not care about exceptions someone else defined...except for printing out their message in main()... - ...not reuse exceptions defined by someone else. Define your own. - ...only if you have a plan... - ...no

Re: vibe.d / experience / feedback

2020-10-12 Thread Andre Pany via Digitalmars-d-learn
On Monday, 12 October 2020 at 11:21:40 UTC, Robert M. Münch wrote: On 12 Oct 2020 at 13:13:27 CEST, "Ola Fosheim Grøstad" wrote: Yes, it is a good fit for web services with medium sized code bases. We don't have a lot of "big project" experience with Go yet, but we would use it for a

Re: Renaming Flag!"" in API

2020-10-12 Thread aliak via Digitalmars-d-learn
On Monday, 12 October 2020 at 10:24:44 UTC, FreeSlave wrote: Let's say I use Flag type named 'myflagname' in API like this: import std.typecons; void func(Flag!"myflagname" flag) { //... } void main() { func(Yes.myflagname); } Later I realize that 'myflagname' is a bad name and I want to

Re: Renaming Flag!"" in API

2020-10-12 Thread Vladimir Panteleev via Digitalmars-d-learn
On Monday, 12 October 2020 at 10:24:44 UTC, FreeSlave wrote: Can this issue overcome somehow? Why not add a deprecated overload for your function which takes the old Flag value?

Re: Renaming Flag!"" in API

2020-10-12 Thread user1234 via Digitalmars-d-learn
On Monday, 12 October 2020 at 10:24:44 UTC, FreeSlave wrote: Let's say I use Flag type named 'myflagname' in API like this: import std.typecons; void func(Flag!"myflagname" flag) { //... } void main() { func(Yes.myflagname); } Later I realize that 'myflagname' is a bad name and I want to

Re: vibe.d / experience / feedback

2020-10-12 Thread Robert M . Münch via Digitalmars-d-learn
On 11 Oct 2020 at 16:46:13 CEST, "Ola Fosheim Grøstad" wrote: > Ada, Java, Eiffel are supposed to. Yes... beside Java, the other two are already in the exotic department... > I'm not sure if Go is a success in that department either. I > suspect it tanks when programs get large. Go seems to

Re: List of exceptions?

2020-10-12 Thread Dominikus Dittes Scherkl via Digitalmars-d-learn
On Saturday, 10 October 2020 at 19:51:10 UTC, DMon wrote: This is where I'm at: import std.stdio; import std.conv; // StdioException // ConvException // StringException // ErrnoException // FormatException // UnicodeException // UTFException // FileMissingException // DataCorruptionException

Re: vibe.d / experience / feedback

2020-10-12 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Monday, 12 October 2020 at 11:06:55 UTC, Robert M. Münch wrote: Go seems to be kept as simple as possible, even if you have to write more code. Which is, in the long run, the cheaper and smaller burden. No tricks, no surprises... that has a lot of merits. Yes, it is a good fit for web

Re: Renaming Flag!"" in API

2020-10-12 Thread Ali Çehreli via Digitalmars-d-learn
It's amazing how things come together before each conference. Flag appears among my slides for an upcoming conference as well! :) But I don't think there is any solution to your problem. On 10/12/20 3:24 AM, FreeSlave wrote: > Later I realize that 'myflagname' is a bad name and I want to

Phobos Unittesting

2020-10-12 Thread starcanopy via Digitalmars-d-learn
I'm working on adding support for Windows' symlinks in std.file. std.file.symlink's augmentation is straightforward, but testing it is not as easy. The reason is because, normally, one must confer escalated privileges to the executable making the link via CreateSymbolicLink[A|W]. This may be

Re: vibe.d / experience / feedback

2020-10-12 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Monday, 12 October 2020 at 11:06:55 UTC, Robert M. Münch wrote: Go seems to be kept as simple as possible, even if you have to write more code. Which is, in the long run, the cheaper and smaller burden. No tricks, no surprises... that has a lot of merits. Btw, Go has some major weaknesses

Re: List of exceptions?

2020-10-12 Thread Ali Çehreli via Digitalmars-d-learn
On 10/12/20 2:11 AM, Dominikus Dittes Scherkl wrote: > - Throw exceptions only if you have a plan what to do with them if you > catch them. My thinking is different: Throw exceptions if you can't accomplish a task. My code is filled with enforce() and assert() checks, which do throw

Re: vibe.d / experience / feedback

2020-10-12 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Monday, 12 October 2020 at 11:21:40 UTC, Robert M. Münch wrote: Even most people seem to use Go for the web services stuff, I think it might be underrate for desktop apps. Go is good at what it has Go libraries for, and I believe it has gotten quite a few over the past years, some that has

Re: Renaming Flag!"" in API

2020-10-12 Thread FreeSlave via Digitalmars-d-learn
On Monday, 12 October 2020 at 16:44:52 UTC, Ali Çehreli wrote: It's amazing how things come together before each conference. Flag appears among my slides for an upcoming conference as well! :) But I don't think there is any solution to your problem. On 10/12/20 3:24 AM, FreeSlave wrote: >

How to add an additional config dir in DUB under source?

2020-10-12 Thread tastyminerals via Digitalmars-d-learn
I have the following project structure: source/ media/ icon.png config/ conf.toml In order to access "icon.png" without explicitly providing the path I added in dub.json "stringImportPaths": [ "source/media", "source/config" ] It works for "icon.png" but doesn't work for

Re: How to add an additional config dir in DUB under source?

2020-10-12 Thread Mike Parker via Digitalmars-d-learn
On Tuesday, 13 October 2020 at 05:13:18 UTC, Mike Parker wrote: not available. The very first restriction on CTFE is this: "The function source code must be available to the compiler. Functions which exist in the source code only as extern declarations cannot be executed in CTFE." Forgot

Re: How to add an additional config dir in DUB under source?

2020-10-12 Thread Mike Parker via Digitalmars-d-learn
On Monday, 12 October 2020 at 22:31:53 UTC, tastyminerals wrote: I wonder why and what am I doing wrong? This: readText("conf.toml"); "stringImportPath" (dmd's -J command line option) is specifically for D's import expression (which is different from the import statement, e.g., `import