Re: Assocative array lookup for object

2023-04-11 Thread Salih Dincer via Digitalmars-d-learn
On Wednesday, 12 April 2023 at 01:16:17 UTC, Chris Katko wrote: Should I be using opEquals? Or something different? The problem with 'alias this' here is I want to wrap access to the insides with getter functions that do various things like logging and error checking. I think you want to do

Re: Assocative array lookup for object

2023-04-11 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
You want the operator overload opIndex inside your class. https://dlang.org/spec/operatoroverloading.html#array

Assocative array lookup for object

2023-04-11 Thread Chris Katko via Digitalmars-d-learn
```D class bitmapHandler { bitmap*[string] bmps; void get(string name){return bmps[name]; /* plus other code */} } void usage() { bitmapHandler bh; bitmap foo = bh.get("bar"); // works bitmap foo2 = bh["bar"]; // desired } ``` Should I be using opEquals? Or something different? The problem

Re: How to setup D with SFML? (using bindbc-sfml)

2023-04-11 Thread Ki Rill via Digitalmars-d-learn
On Tuesday, 11 April 2023 at 11:55:50 UTC, Richard (Rikki) Andrew Cattermole wrote: I have to ask this since nothing else has worked and the dll's on the site don't depend on a MSVC dll: What are you compiling your program as? 32bit/64bit x86? ARM? Which DLL's are you downloading? 32bit,

Re: mutable pointers as associative array keys

2023-04-11 Thread John Colvin via Digitalmars-d-learn
On Monday, 10 April 2023 at 20:31:43 UTC, Steven Schveighoffer wrote: On 4/10/23 4:25 PM, Steven Schveighoffer wrote: It's also completely useless. Having const keys does nothing to guarantee unchanging keys. Another half-assed attempt to be encode correct semantics but fails completely in its

learning D as your first language but having difficulty in making or logic building in order to make software

2023-04-11 Thread slectr via Digitalmars-d-learn
I want to make software like krita inkscape and my own language using D Although i previosly learned C and C++ i left it in the middle and for some reasons i dont want to learn those so i searched for alternatives and found D but there are not a lot of resources like cookbooks and videos as

SO_PRIORITY

2023-04-11 Thread IchorDev via Digitalmars-d-learn
`std.socket` is missing a `SocketOption`-equivalent to `SO_PRIORITY`. Is this an intentional omission (and if so, why?), or should I try to submit a PR to add it?

Re: How to setup D with SFML? (using bindbc-sfml)

2023-04-11 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
I have to ask this since nothing else has worked and the dll's on the site don't depend on a MSVC dll: What are you compiling your program as? 32bit/64bit x86? ARM? Which DLL's are you downloading? 32bit, 64bit?

Re: How to setup D with SFML? (using bindbc-sfml)

2023-04-11 Thread Ki Rill via Digitalmars-d-learn
On Sunday, 9 April 2023 at 14:20:30 UTC, Mike Parker wrote: I've tried your project out two ways, one that succeeds and one that fails. I'm guessing you've put your 'libs' directory is 'bin/libs'. Am I right? If so, then the following should help you. Well, `bin/` and `libs/` are in the