Re: DlangUI Layout Justification

2023-04-10 Thread ShadoLight via Digitalmars-d-learn
On Friday, 7 April 2023 at 17:13:58 UTC, Adam D Ruppe wrote: On Friday, 7 April 2023 at 15:52:02 UTC, Ali Çehreli wrote: I don't know how relevant it is but there is also Hipreme Engine that supports Android: [...] One library can help with both games and guis but it is unlikely to be a

Re: My vibe-d test app is crashing on Windows

2023-02-13 Thread ShadoLight via Digitalmars-d-learn
On Monday, 13 February 2023 at 13:12:23 UTC, Steve wrote: The app is just a test echo server. JSON sent in the body of a POST request is echoed back to the client. On Pop!_OS it works fine but on Windows it responds, there's a delay of about 10 seconds and then it crashes with the error: ```

Re: pointer escaping return scope bug?

2022-11-25 Thread ShadoLight via Digitalmars-d-learn
On Friday, 25 November 2022 at 14:07:28 UTC, ShadoLight wrote: On Saturday, 19 November 2022 at 14:07:59 UTC, Nick Treleaven ```d @safe: struct LockedFile { private int* fps; auto fp() return scope => fps; } void main() { int* p; { auto lf = LockedFile(new int);

Re: pointer escaping return scope bug?

2022-11-25 Thread ShadoLight via Digitalmars-d-learn
On Saturday, 19 November 2022 at 15:00:16 UTC, Paul Backus wrote: On Saturday, 19 November 2022 at 14:07:59 UTC, Nick Treleaven wrote: Hi, The following seems like a bug to me (reduced code, FILE* changed to int*): ```d @safe: struct LockedFile { private int* fps; auto fp() return

Re: How to link a msvcr120.dll in an inverse recursive way after a Windows .exe binary deployment

2022-09-06 Thread ShadoLight via Digitalmars-d-learn
On Tuesday, 6 September 2022 at 04:59:49 UTC, Mike Parker wrote: On Tuesday, 6 September 2022 at 04:36:55 UTC, ShadoLight wrote: True. In that case just distribute the DLL (taken from the DMD bin folder) alongside the HelloWorld EXE so that both reside in the same folder on the target

Re: How to link a msvcr120.dll in an inverse recursive way after a Windows .exe binary deployment

2022-09-05 Thread ShadoLight via Digitalmars-d-learn
On Monday, 5 September 2022 at 07:02:53 UTC, BoQsc wrote: The problem is, D Language Compiler is not included along the Windows Operating System. No compiler is included natively with the Windows OS. Not even Microsoft's. Neither msvcr120.dll is included along the Windows Operating

Re: How to link a msvcr120.dll in an inverse recursive way after a Windows .exe binary deployment

2022-09-04 Thread ShadoLight via Digitalmars-d-learn
On Sunday, 4 September 2022 at 15:16:47 UTC, BoQsc wrote: **Folder structure** .\msvcr120.dll .\folder1\HelloWorld.exe .\folder2\HelloWorld.exe You don't need to do this. msvcr120.dll is already shipped with the DMD compiler at [DMD-install-folder]\windows\bin64\msvcr120.dll. (It is also

Re: What are virtual functions?

2021-04-18 Thread ShadoLight via Digitalmars-d-learn
On Wednesday, 14 April 2021 at 14:06:18 UTC, FeepingCreature wrote: On Wednesday, 14 April 2021 at 13:43:20 UTC, Berni44 wrote: [..] Covariance is related ... [..] The opposite (contravariance) happens ... [..] Nice answer but, just to be clear - D only supports covariance on return

Re: F*cked by memory corruption after assiging value to associative array

2021-01-29 Thread ShadoLight via Digitalmars-d-learn
On Monday, 25 January 2021 at 17:11:37 UTC, frame wrote: On Monday, 25 January 2021 at 16:54:42 UTC, vitamin wrote: On Monday, 25 January 2021 at 16:44:40 UTC, frame wrote: On Monday, 25 January 2021 at 16:14:05 UTC, vitamin wrote: Yes, I directly calling on every function that returns an

Re: Range of dub package versions

2020-12-29 Thread ShadoLight via Digitalmars-d-learn
On Monday, 28 December 2020 at 23:49:02 UTC, rikki cattermole wrote: $ dub upgrade [..] Unless you change the version invalidating it, it most likely won't upgrade by itself. Thanks Rikki - that explains it and, indeed, worked perfectly. Thanks!

Range of dub package versions

2020-12-28 Thread ShadoLight via Digitalmars-d-learn
I can build my app using dub, which has a dependency on the particular version of dlangui that was available when I originally created the project: "dependencies": { "dlangui": "~>0.9.182", ...etc.. }, I've recently noticed that the dlangui

Re: Why private methods cant be virtual?

2020-09-23 Thread ShadoLight via Digitalmars-d-learn
On Tuesday, 22 September 2020 at 11:39:31 UTC, Daniel Kozak wrote: On Tue, Sep 22, 2020 at 1:30 PM ShadoLight via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: This is not really "overriding", it is more akin to "overloading" No it is not

Re: Why private methods cant be virtual?

2020-09-22 Thread ShadoLight via Digitalmars-d-learn
On Tuesday, 22 September 2020 at 10:23:08 UTC, Daniel Kozak wrote: On Tue, Sep 22, 2020 at 11:06 AM claptrap via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: "Functions marked as final may not be overridden in a derived class, unless they are also private" So final

Re: "Programming in D" on Educative.io

2020-05-15 Thread ShadoLight via Digitalmars-d-announce
On Friday, 15 May 2020 at 03:22:43 UTC, dangbinghoo wrote: On Thursday, 14 May 2020 at 08:42:43 UTC, ShadoLight wrote: On Wednesday, 13 May 2020 at 19:25:43 UTC, welkam wrote: [...] This opinion seems quite common in the D community, but I frankly don't see it. If you are referring to the D

Re: "Programming in D" on Educative.io

2020-05-14 Thread ShadoLight via Digitalmars-d-announce
On Wednesday, 13 May 2020 at 19:25:43 UTC, welkam wrote: On Thursday, 7 May 2020 at 09:18:04 UTC, Ali Çehreli wrote: Because D is a re-engineering of C++ I thought it was re-engineering of C This opinion seems quite common in the D community, but I frankly don't see it. If you are

Re: Visual D 0.52.0 released

2020-03-24 Thread ShadoLight via Digitalmars-d-announce
On Tuesday, 24 March 2020 at 12:44:38 UTC, Rainer Schuetze wrote: On 24/03/2020 12:01, ShadoLight wrote: On Tuesday, 24 March 2020 at 10:55:28 UTC, ShadoLight wrote: On Monday, 23 March 2020 at 09:54:46 UTC, Rainer Schuetze wrote: Hi, a new version of Visual D, the Visual Studio extension

Re: Visual D 0.52.0 released

2020-03-24 Thread ShadoLight via Digitalmars-d-announce
On Tuesday, 24 March 2020 at 10:55:28 UTC, ShadoLight wrote: On Monday, 23 March 2020 at 09:54:46 UTC, Rainer Schuetze wrote: Hi, a new version of Visual D, the Visual Studio extension that adds D language support to VS2008-2019, is available at [snip] As always - VisualD is highly

Re: Visual D 0.52.0 released

2020-03-24 Thread ShadoLight via Digitalmars-d-announce
On Monday, 23 March 2020 at 09:54:46 UTC, Rainer Schuetze wrote: Hi, a new version of Visual D, the Visual Studio extension that adds D language support to VS2008-2019, is available at [snip] As always - VisualD is highly appreciated Rainer! A minor issue (typo probably), the installer

Re: Alternative to friend functions?

2020-02-20 Thread ShadoLight via Digitalmars-d-learn
On Thursday, 20 February 2020 at 08:02:48 UTC, Bienlein wrote: On Tuesday, 18 February 2020 at 12:43:22 UTC, Adnan wrote: What is the alternative to C++'s friend functions in D? module stable_matching; alias FemaleID = int; alias MaleID = int; class Person { string name; int id; }

Re: Template Usage with Eponymous Trick

2020-02-02 Thread ShadoLight via Digitalmars-d-learn
On Sunday, 2 February 2020 at 23:48:45 UTC, Paul Backus wrote: On Sunday, 2 February 2020 at 23:39:10 UTC, ShadoLight wrote: But, my question was if this was avoidable if braces were not optional. Paul's answer was that non-optional braces will not make... alias a = S!(int); ...

Re: Template Usage with Eponymous Trick

2020-02-02 Thread ShadoLight via Digitalmars-d-learn
On Sunday, 2 February 2020 at 18:30:17 UTC, Steven Schveighoffer wrote: Thanks for taking the time to explain. However, when I tested my results does not seem to match your explanation. First, note that: struct S(T) {} is *exactly* equivalent to (in fact, you can write it this way, and

Re: Template Usage with Eponymous Trick

2020-02-02 Thread ShadoLight via Digitalmars-d-learn
On Sunday, 2 February 2020 at 16:23:42 UTC, Paul Backus wrote: [..] No, it would still be ambiguous: struct S(T) {} alias a = S!(int); // Should this assertion pass or fail? static assert(is(a)); Sorry, I don't get it. AFAICS 'is(a)' should return true (since a is an alias for a full

Re: Template Usage with Eponymous Trick

2020-02-02 Thread ShadoLight via Digitalmars-d-learn
On Friday, 31 January 2020 at 15:37:06 UTC, Steven Schveighoffer wrote: On 1/30/20 9:10 AM, ShadoLight wrote: but to give you some historical perspective... [..] It was actually much more restrictive before -- e.g. in order to do an eponymous template, you could have no other members

Re: Template Usage with Eponymous Trick

2020-01-30 Thread ShadoLight via Digitalmars-d-learn
On Thursday, 30 January 2020 at 20:42:02 UTC, Paul Backus wrote: On Thursday, 30 January 2020 at 15:14:43 UTC, ShadoLight wrote: [..] would make the language grammatically ambiguous... OK, understood. Thank you.

Re: Template Usage with Eponymous Trick

2020-01-30 Thread ShadoLight via Digitalmars-d-learn
On Thursday, 30 January 2020 at 20:00:05 UTC, MoonlightSentinel wrote: On Thursday, 30 January 2020 at 17:00:08 UTC, ShadoLight wrote: [..] ...your proposed change it would be ambigous ... Ok, that makes sense - I did not consider the impact of the optional empty braces. Thank you.

Re: Template Usage with Eponymous Trick

2020-01-30 Thread ShadoLight via Digitalmars-d-learn
On Thursday, 30 January 2020 at 16:16:48 UTC, MoonlightSentinel wrote: On Thursday, 30 January 2020 at 15:14:43 UTC, ShadoLight wrote: [...] From my POV is void foo(T)() { ... } just a shorthand notation for... Agreed. My question though is should the 'shorthand' notation _replace_ the

Re: Template Usage with Eponymous Trick

2020-01-30 Thread ShadoLight via Digitalmars-d-learn
On Thursday, 30 January 2020 at 14:22:11 UTC, Paul Backus wrote: On Thursday, 30 January 2020 at 14:10:38 UTC, ShadoLight wrote: ...but in the 'classical' default template style, so I would have thought the template_name!(compile_time_args).function_name(run_time_args) style would still work,

Re: Template Usage with Eponymous Trick

2020-01-30 Thread ShadoLight via Digitalmars-d-learn
On Thursday, 30 January 2020 at 14:10:38 UTC, ShadoLight wrote: Taking this example from documentation page on 'Template Sequence Parameters' [1]: [...] Tested on https://run.dlang.io

Template Usage with Eponymous Trick

2020-01-30 Thread ShadoLight via Digitalmars-d-learn
Taking this example from documentation page on 'Template Sequence Parameters' [1]: import std.stdio; template print(args...) { void print() { writeln("args are ", args); // args is a ValueSeq } } template write(Args...) { void write(Args args) // Args is a TypeSeq

Re: How load icon from resource using LoadImage?

2020-01-06 Thread ShadoLight via Digitalmars-d-learn
On Sunday, 5 January 2020 at 13:52:27 UTC, JN wrote: On Sunday, 5 January 2020 at 13:33:35 UTC, Marcone wrote: [snip] By the way, have you managed to add the res file into the binary? My understanding is that the res file should be added into the exe file by the rc command before it can be

Re: How to use ResizerWidget in Dlangui app..?

2020-01-03 Thread ShadoLight via Digitalmars-d-learn
On Thursday, 2 January 2020 at 05:24:33 UTC, Rémy Mouëza wrote: On Monday, 30 December 2019 at 23:32:37 UTC, ShadoLight wrote: Hi, I suspect I'm missing something obvious, but ResizerWidget is not working for me on Windows - it shows the 'dragging'-cursor when hovering the mouse on the

Re: How to use ResizerWidget in Dlangui app..?

2020-01-01 Thread ShadoLight via Digitalmars-d-learn
On Thursday, 2 January 2020 at 05:24:33 UTC, Rémy Mouëza wrote: On Monday, 30 December 2019 at 23:32:37 UTC, ShadoLight wrote: Hi, I suspect I'm missing something obvious, but ResizerWidget is not working for me on Windows - it shows the 'dragging'-cursor when hovering the mouse on the

Re: How to use ResizerWidget in Dlangui app..?

2020-01-01 Thread ShadoLight via Digitalmars-d-learn
On Wednesday, 1 January 2020 at 10:52:02 UTC, Ron Tarrant wrote: On Monday, 30 December 2019 at 23:32:37 UTC, ShadoLight wrote: dragging with the left mouse button does nothing. Window window = Platform.instance.createWindow("DlangUI example", null); I'm not familiar with this toolkit,

How to use ResizerWidget in Dlangui app..?

2019-12-30 Thread ShadoLight via Digitalmars-d-learn
Hi, I suspect I'm missing something obvious, but ResizerWidget is not working for me on Windows - it shows the 'dragging'-cursor when hovering the mouse on the ResizerWidget, but dragging with the left mouse button does nothing. Reduced very simple example: ///app.d import dlangui; import

Re: How add "version.txt" Version File by Command Line or by resources.res using dmd.exe

2019-12-10 Thread ShadoLight via Digitalmars-d-learn
On Tuesday, 10 December 2019 at 14:33:41 UTC, Marcone wrote: On Tuesday, 10 December 2019 at 09:48:11 UTC, ShadoLight wrote: On Tuesday, 10 December 2019 at 07:23:00 UTC, rumbu wrote: [...] To add to Rumbo's comment: to compile a *.rc to *.res file you will need a resource compiler. [...]

Re: How add "version.txt" Version File by Command Line or by resources.res using dmd.exe

2019-12-10 Thread ShadoLight via Digitalmars-d-learn
On Tuesday, 10 December 2019 at 07:23:00 UTC, rumbu wrote: On Sunday, 8 December 2019 at 20:50:05 UTC, Marcone wrote: I want to add version to my program. I have configurated my version file "version.txt", but I dont know how link this file to my program. If Need spec file, please send the

Re: How polymorphism work in D?

2019-11-06 Thread ShadoLight via Digitalmars-d-learn
On Wednesday, 6 November 2019 at 06:27:32 UTC, OiseuKodeur wrote: On Wednesday, 6 November 2019 at 06:05:25 UTC, rikki cattermole wrote: On 06/11/2019 6:43 PM, OiseuKodeur wrote: I have this [snip] Rikki's answer is the direct answer to your question since you already had the if(..)

Re: Is this a bug? +goto

2018-11-09 Thread ShadoLight via Digitalmars-d-learn
On Thursday, 8 November 2018 at 09:34:34 UTC, Michelle Long wrote: What I am talking about is about an obvious error... OK, so here are your code slightly modified: void main(){ int i; W: if(i==0) goto Q; int x; Q: i++; if(i==1) goto W; writeln("a");

Re: Wed Oct 17 - Avoiding Code Smells by Walter Bright

2018-11-04 Thread ShadoLight via Digitalmars-d-announce
On Saturday, 3 November 2018 at 03:58:16 UTC, Ali Çehreli wrote: On 11/02/2018 03:18 AM, ShadoLight wrote: > Maybe you are thinking of the "Prefer non-member non-friend functions to > member functions" rule from Herb Sutter's "Effective C++" books? Scott Meyers. Ali Thanks for the

Re: Wed Oct 17 - Avoiding Code Smells by Walter Bright

2018-11-02 Thread ShadoLight via Digitalmars-d-announce
On Friday, 2 November 2018 at 00:53:52 UTC, H. S. Teoh wrote: And along that line, recent wisdom is that it's better to move things *out* of classes (and structs) if they don't need access to private members. (Sorry, I wanted to include a link for this, but I couldn't find the article -- the

Re: Data structures and algorithms in D?

2018-10-08 Thread ShadoLight via Digitalmars-d-learn
On Sunday, 7 October 2018 at 20:27:47 UTC, eastanon wrote: Are there reading resources on Data structures and Algorithms in D? There are several such books in the C/C++ and Java world and many senior/experienced D users might have come across them in C. But for people who join D after reading

Re: Please don't do a DConf 2018, consider alternatives

2018-10-02 Thread ShadoLight via Digitalmars-d
[snip] However constructive your alternate proposals are, I suspect people are misreading your title (and it is easy to assume, just from the OP title, that you actually want to get 'get rid of' DConf, rather than just 'modify' and 'improve' DConf. Personally I feel there is a cognitive

Re: OT: Bad translations

2018-09-26 Thread ShadoLight via Digitalmars-d
On Wednesday, 26 September 2018 at 02:12:07 UTC, Ali Çehreli wrote: On 09/24/2018 08:17 AM, 0xEAB wrote: > - Non-idiomatic translations of tech terms [2] [snip] English message was something like "No memory left" and the German translation was "No memory on the left hand side" :) Ali Not

Re: D IDE

2018-09-05 Thread ShadoLight via Digitalmars-d
On Wednesday, 5 September 2018 at 13:11:18 UTC, Jonathan M Davis wrote: [snip] Except that you don't have projects or solutions with something like vim or emacs. There is no structure specific to them. You can set them up to do the build from inside them, and with emacs, you can run gdb

Re: D IDE

2018-09-05 Thread ShadoLight via Digitalmars-d
On Tuesday, 4 September 2018 at 22:38:08 UTC, Nick Sabalausky (Abscissa) wrote: On 09/04/2018 04:00 PM, Jonathan M Davis wrote: On Tuesday, September 4, 2018 5:56:54 AM MDT ShadoLight via Digitalmars-d wrote: We work full-time for employers which, in my case, employs thousands of engineers

Re: D IDE

2018-09-04 Thread ShadoLight via Digitalmars-d
On Tuesday, 4 September 2018 at 00:16:16 UTC, Nick Sabalausky (Abscissa) wrote: On 09/03/2018 02:55 PM, Joakim wrote: On Monday, 3 September 2018 at 16:55:10 UTC, Jonathan M Davis wrote: But if you're ever expecting IDE support to be a top priority of many of the contributors, then you're

Re: DIP 1016--ref T accepts r-values--Community Review Round 1

2018-07-25 Thread ShadoLight via Digitalmars-d
On Saturday, 21 July 2018 at 08:59:39 UTC, Manu wrote: On Sat, 21 Jul 2018 at 00:15, Johannes Loher via Digitalmars-d wrote: On Saturday, 21 July 2018 at 05:59:37 UTC, Manu wrote: > [...] Let me give a concrete example of one of the situations Jonathan is describing. Consider the following

Re: 'static foreach' chapter and more

2018-06-26 Thread ShadoLight via Digitalmars-d-announce
On Tuesday, 26 June 2018 at 01:52:42 UTC, Ali Çehreli wrote: I've made some online improvements to "Programming in D" since September 2017. http://ddili.org/ders/d.en/index.html Ali Hi Ali, Thanks for your book - it is the definitive go-to resource for D newcomers as well as

Re: Article: Why Const Sucks

2018-03-05 Thread ShadoLight via Digitalmars-d-announce
Very interesting and well written! Jonathan, your experiences with const in C++/Java just about matches my experiences with it. I also feel that the situation in D is less than ideal in this regard. First, a small (for sure copy-pasta) typo in your article: const(int[]) arr1 = getArray();

Link to https://run.dlang.io/ ??

2018-02-20 Thread ShadoLight via Digitalmars-d-learn
It would be nice if there was a link to https://run.dlang.io/ on the dlang website - preferably under Resources drop-down menu or similar. Or is there somewhere and I am just missing it? I have bookmarked it for myself, but it would be better for newbies if it was also easily accessible from

Re: Error in template instantiation from D-Cookbook example

2018-02-09 Thread ShadoLight via Digitalmars-d-learn
On Friday, 9 February 2018 at 21:39:22 UTC, Adam D. Ruppe wrote: On Friday, 9 February 2018 at 21:31:29 UTC, ShadoLight wrote: [1] https://run.dlang.io/is/dyElXg There's missing quotes in there: Line 14: code ~= "push(call!"~piece~"(pop(), pop()));\n"; Should be: code ~=

Error in template instantiation from D-Cookbook example

2018-02-09 Thread ShadoLight via Digitalmars-d-learn
Hi, Trying to improve my CT-fu, I looked at a DSL example (chapter 9) in Adam's D-Cookbook. Although I am sure Adam's original examples would have worked, there were some errors in the example code in the book. The example also contains some code to allow you to test the functions at RT,