Re: D Garbage Collector reference

2025-03-26 Thread Ian via Digitalmars-d-learn
On Tuesday, 25 March 2025 at 22:12:52 UTC, Sergey wrote: Hi there This is from my list: - https://dlang.org/blog/the-gc-series/ - https://forum.dlang.org/post/lkjgoekakzjfjijoj...@forum.dlang.org - https://olshansky.me/posts/2017-06-15-inside-d-gc/ - https://theartofmachinery.com/2019/04/26/b

D Garbage Collector reference

2025-03-25 Thread Ian via Digitalmars-d-learn
Hi, I am curious about the low level details of D's garbage collector. Is there a good reference in this regard? I have many questions... Cheers, Ian

Re: Newbie style question about string constants

2025-03-17 Thread Ian via Digitalmars-d-learn
On Monday, 17 March 2025 at 08:27:17 UTC, Jonathan M Davis wrote: In any case, the normal way in D to declare a string constant is to use enum. So, that's primarily what you're going to see in most code. Whether you choose to do that in your own code is up to you. - Jonathan M Davis Hi Jo

Re: Newbie style question about string constants

2025-03-16 Thread Ian via Digitalmars-d-learn
On Tuesday, 25 February 2025 at 00:34:45 UTC, Jonathan M Davis wrote: For strings, the way that you normally do constants is with enum, e.g enum foo = "dlang"; An enum like this is called a manifest constant. And you use manifest constants for most constants in D, with the caveat that fo

Newbie style question about string constants

2025-02-24 Thread Ian via Digitalmars-d-learn
Hello, What's the recommended D way to declare a string constant? Say, for example, for a path used inside a class constructor? I've seen const string, immutable, enum etc... Is this the place for these kinds of questions? Is there a D stack overflow? Cheers, Ian

Re: Intro to calling C libraries

2025-02-24 Thread Ian via Digitalmars-d-learn
Sweet!

Re: Gtkd questions

2025-02-20 Thread Ian via Digitalmars-d-learn
On Thursday, 20 February 2025 at 21:24:29 UTC, Sergey wrote: On Sunday, 22 September 2024 at 15:44:17 UTC, Ian wrote: Hi, I have started using Gtkd for my first D app. (Many thanks to Ron Tarrant for gtkcoding.com by the way!) Is there a place where I can ask specific Gtkd questions? I came a

Re: Intro to calling C libraries

2025-02-20 Thread Ian via Digitalmars-d-learn
On Thursday, 20 February 2025 at 21:05:40 UTC, Lance Bachmeier wrote: Normally, you should be using ImportC. Look at the quick example from the spec: https://dlang.org/spec/importc.html#examples The first line of hello.c looks like this: ``` #include ``` When ImportC compiles a C file, it

Re: Gtkd questions

2025-02-20 Thread Ian via Digitalmars-d-learn
On Sunday, 22 September 2024 at 15:46:48 UTC, Dejan Lekic wrote: On Sunday, 22 September 2024 at 15:44:17 UTC, Ian wrote: Ron Tarrant for gtkcoding.com by the way!) Is there a place where I can ask specific Gtkd questions? I came across some For many years this has been the main place to ask G

Intro to calling C libraries

2025-02-20 Thread Ian via Digitalmars-d-learn
Hi, What is the recommended documentation or introductory material on how to call C libraries from D? I've seen it done in GtkD (for GTK3) and I have heard of -betterC, but it's all a little overwhelming. (I'm an experienced C programmer but new to D) Cheers, Ian

Re: Why is DList insertion log n?

2025-02-17 Thread Ian via Digitalmars-d-learn
On Sunday, 16 February 2025 at 20:57:58 UTC, rkompass wrote: From the source code at [https://github.com/dlang/phobos/blob/master/std/container/dlist.d#L784](https://github.com/dlang/phobos/blob/master/std/container/dlist.d#L784) I would say it is O(1), as you expected. So the docs you refer to

Why is DList insertion log n?

2025-02-16 Thread Ian via Digitalmars-d-learn
Hi, I'm looking at the double linked list in std.containers and it says that insertion in front or back are O(log n). How come they are not O(1) ? https://dlang.org/phobos/std_container_dlist.html#.DList.insertFront Also, is this question more for "General"? I'm a "new user" and "learning"

Re: Simple string membership test

2025-02-15 Thread Ian via Digitalmars-d-learn
On Saturday, 15 February 2025 at 18:13:39 UTC, Sergey wrote: On Saturday, 15 February 2025 at 17:58:44 UTC, Ian wrote: Hi, What's the best (idiomatic) way of checking if a string is in a list of strings: ```d string v = "tofind"; if (v ismemberof ["abc", "def","tofind"]) etc(); ``` Thank

Simple string membership test

2025-02-15 Thread Ian via Digitalmars-d-learn
Hi, What's the best (idiomatic) way of checking if a string is in a list of strings: ```d string v = "tofind"; if (v ismemberof ["abc", "def","tofind"]) etc(); ``` Thanks, ian

Wiki in D?

2025-02-12 Thread Ian via Digitalmars-d-learn
Is there an open source wiki written in D? ~I

Best practices for class instance variables as parameters

2024-09-28 Thread Ian via Digitalmars-d-learn
Hi, I'm coming from C and some C++ so the way D stores class instance variables is new to me. If I'm not mistaken the basic unadorned instance variable is like a "hidden" pointer. So, when passing class instance variables to a function, what would be the point of passing a pointer or ref? I

Gtkd questions

2024-09-22 Thread Ian via Digitalmars-d-learn
Hi, I have started using Gtkd for my first D app. (Many thanks to Ron Tarrant for gtkcoding.com by the way!) Is there a place where I can ask specific Gtkd questions? I came across some post at some point mentioning they may have another forum but I don't remember it now. Cheers, Ian

Re: Getting started

2024-08-10 Thread Ian via Digitalmars-d-learn
On Saturday, 10 August 2024 at 18:11:25 UTC, Sergey wrote: On Saturday, 10 August 2024 at 16:50:11 UTC, Ian wrote: How do I get started with Windows desktop programming in D? Any recommended IDEs? (I have decent experience with C/C++) Hi Ian. Many people who previously worked with Visual Stud