Re: Best way to use large C library in D as of 2024

2024-03-29 Thread harakim via Digitalmars-d-learn
On Tuesday, 26 March 2024 at 20:42:00 UTC, Chris Piker wrote: On Tuesday, 26 March 2024 at 20:19:27 UTC, bachmeier wrote: Should be able to just use it, as described here: https://forum.dlang.org/post/qxctappnigkwvaqak...@forum.dlang.org Create a .c file that includes the header files and

Re: How to make fields inaccessible (unreadable and unachangeable) outside of the structure?

2024-03-29 Thread matheus via Digitalmars-d-learn
On Saturday, 30 March 2024 at 02:11:25 UTC, zjh wrote: On Friday, 29 March 2024 at 22:50:53 UTC, curiousprogramma08 wrote: you can use openD. Wait a minute, they already added this modification into their language? Interesting! Matheus.

Re: How to make fields inaccessible (unreadable and unachangeable) outside of the structure?

2024-03-29 Thread zjh via Digitalmars-d-learn
On Friday, 29 March 2024 at 22:50:53 UTC, curiousprogramma08 wrote: you can use openD.

Re: How to make fields inaccessible (unreadable and unachangeable) outside of the structure?

2024-03-29 Thread matheus via Digitalmars-d-learn
On Friday, 29 March 2024 at 22:50:53 UTC, curiousprogramma08 wrote: ... If I'm not mistaken, like in classes "private" is module based: https://wiki.dlang.org/Access_specifiers_and_visibility Matheus.

Re: How to make fields inaccessible (unreadable and unachangeable) outside of the structure?

2024-03-29 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, March 29, 2024 4:50:53 PM MDT curiousprogramma08 via Digitalmars-d- learn wrote: > ```d > struct QueueNode > { > > private int data; > private QueueNode *next = null; > > this(int data) > { > this.data = data; > } > } > ``` > I also tried to write it

How to make fields inaccessible (unreadable and unachangeable) outside of the structure?

2024-03-29 Thread curiousprogramma08 via Digitalmars-d-learn
```d struct QueueNode { private int data; private QueueNode *next = null; this(int data) { this.data = data; } } ``` I also tried to write it like this too: ```d struct QueueNode { private: int data; QueueNode *next = null; public: this(int

Re: Setting up a final switch from a list

2024-03-29 Thread Salih Dincer via Digitalmars-d-learn
On Friday, 29 March 2024 at 00:37:21 UTC, Jonathan M Davis wrote: On Thursday, March 28, 2024 4:21:03 PM MDT Salih Dincer via Digitalmars-d- learn wrote: How can we add all members of an enum type to a list without duplicating code? As the documentation for EnumMembers explains, you can use