Re: Is there such concept of a list in D?

2022-12-19 Thread Mike Parker via Digitalmars-d-learn
On Monday, 19 December 2022 at 22:22:11 UTC, thebluepandabear wrote: No worries, hopefully a mod will explain why. I don't like when posts get removed for no reason :| I received a report of a possible troll in the forums. Looking at the posts collectively, I agreed, so deleted all of them.

Re: Is there such concept of a list in D?

2022-12-19 Thread Salih Dincer via Digitalmars-d-learn
On Monday, 19 December 2022 at 22:22:11 UTC, thebluepandabear wrote: No worries, hopefully a mod will explain why. I don't like when posts get removed for no reason :| AI surround us in forum. People want to video chat now. In the time we live in, you can't be sure what to trust! SDB@79

Re: Is there such concept of a list in D?

2022-12-19 Thread thebluepandabear via Digitalmars-d-learn
No worries, hopefully a mod will explain why. I don't like when posts get removed for no reason :|

Re: Is there such concept of a list in D?

2022-12-19 Thread Ali Çehreli via Digitalmars-d-learn
On 12/19/22 14:14, thebluepandabear wrote: > Yeah I am sure it was on this thread. One of the posts was at > https://forum.dlang.org/post/kzvnajixjdnlcupsl...@forum.dlang.org, it > now shows 'Not Found'. Then I don't know. (?) However, I realize my ThunderBird "evidence" is useless because if

Re: Is there such concept of a list in D?

2022-12-19 Thread thebluepandabear via Digitalmars-d-learn
On Monday, 19 December 2022 at 22:07:15 UTC, Ali Çehreli wrote: On 12/19/22 13:45, thebluepandabear wrote: > On Monday, 19 December 2022 at 21:41:45 UTC, thebluepandabear wrote: >> Why did my replies here to someone else get deleted? > > Myself and this other person's reply to this thread

Re: Is there such concept of a list in D?

2022-12-19 Thread Ali Çehreli via Digitalmars-d-learn
On 12/19/22 13:45, thebluepandabear wrote: > On Monday, 19 December 2022 at 21:41:45 UTC, thebluepandabear wrote: >> Why did my replies here to someone else get deleted? > > Myself and this other person's reply to this thread randomly got removed > for no reason, I would appreciate an explanation

Re: Is there such concept of a list in D?

2022-12-19 Thread thebluepandabear via Digitalmars-d-learn
On Monday, 19 December 2022 at 21:41:45 UTC, thebluepandabear wrote: Why did my replies here to someone else get deleted? Myself and this other person's reply to this thread randomly got removed for no reason, I would appreciate an explanation 

Re: Is there such concept of a list in D?

2022-12-19 Thread thebluepandabear via Digitalmars-d-learn
Why did my replies here to someone else get deleted?

Re: Is there such concept of a list in D?

2022-12-19 Thread IGotD- via Digitalmars-d-learn
On Saturday, 10 December 2022 at 15:59:07 UTC, Ali Çehreli wrote: There isn't a single point in favor of linked lists. Yes there is, there are still special cases where linked lists can be a better alternative. Especially a version with intrusive members (with next/prev pointers as members

Re: Is there such concept of a list in D?

2022-12-18 Thread j via Digitalmars-d-learn
On Monday, 19 December 2022 at 03:31:05 UTC, thebluepandabear wrote: On Sunday, 18 December 2022 at 22:17:04 UTC, j wrote: On Saturday, 10 December 2022 at 05:46:26 UTC, thebluepandabear wrote: In most languages there is some sort of `List` type, is that the same for D? What you're

Re: Is there such concept of a list in D?

2022-12-18 Thread thebluepandabear via Digitalmars-d-learn
On Sunday, 18 December 2022 at 22:17:04 UTC, j wrote: On Saturday, 10 December 2022 at 05:46:26 UTC, thebluepandabear wrote: In most languages there is some sort of `List` type, is that the same for D? What you're probably talking about is called a union in the C world. There is a nice

Re: Is there such concept of a list in D?

2022-12-18 Thread j via Digitalmars-d-learn
On Saturday, 10 December 2022 at 05:46:26 UTC, thebluepandabear wrote: In most languages there is some sort of `List` type, is that the same for D? What you're probably talking about is called a union in the C world. There is a nice (free) book by Ali that every Dlang beginner should

Re: Is there such concept of a list in D?

2022-12-13 Thread areYouSureAboutThat via Digitalmars-d-learn
On Tuesday, 13 December 2022 at 23:34:45 UTC, Salih Dincer wrote: We have nothing to do with unsafe stuff! Why do we waste time with unsafe things; To learn or to teach? SDB@79 @trusted class unsafeVector ... now it's @safe ;-)

Re: Is there such concept of a list in D?

2022-12-13 Thread areYouSureAboutThat via Digitalmars-d-learn
On Tuesday, 13 December 2022 at 23:34:45 UTC, Salih Dincer wrote: We have nothing to do with unsafe stuff! Why do we waste time with unsafe things; To learn or to teach? SDB@79 btw. I reject your axiom: 'We have nothing to do with unsafe stuff!' It is demonstratably not correct, given

Re: Is there such concept of a list in D?

2022-12-13 Thread areYouSureAboutThat via Digitalmars-d-learn
On Tuesday, 13 December 2022 at 23:34:45 UTC, Salih Dincer wrote: We have nothing to do with unsafe stuff! Why do we waste time with unsafe things; To learn or to teach? SDB@79 Really? That example I provided was just to demonstrate that 'yes' you can implement a container using OOP. I

Re: Is there such concept of a list in D?

2022-12-13 Thread Salih Dincer via Digitalmars-d-learn
On Tuesday, 13 December 2022 at 22:51:13 UTC, areYouSureAboutThat wrote: On Saturday, 10 December 2022 at 06:11:18 UTC, thebluepandabear wrote: I was wondering more if there is an object oriented way of creating arrays, like in Java there is an `ArrayList`, in C++ there is `std::vector`,

Re: Is there such concept of a list in D?

2022-12-13 Thread areYouSureAboutThat via Digitalmars-d-learn
On Tuesday, 13 December 2022 at 22:33:02 UTC, Ali Çehreli wrote: Or I can tell what I think, you counter, and we all learn. Proofs... Axioms... Pfft... Ali "I suppose sir, you are going to explain your puzzling remarks."

Re: Is there such concept of a list in D?

2022-12-13 Thread areYouSureAboutThat via Digitalmars-d-learn
On Saturday, 10 December 2022 at 06:11:18 UTC, thebluepandabear wrote: I was wondering more if there is an object oriented way of creating arrays, like in Java there is an `ArrayList`, in C++ there is `std::vector`, etc. of course there is - I mean just imagine if there wasn't ;-) e.g (an

Re: Is there such concept of a list in D?

2022-12-13 Thread Ali Çehreli via Digitalmars-d-learn
On 12/13/22 14:21, areYouSureAboutThat wrote: > On Saturday, 10 December 2022 at 15:59:07 UTC, Ali Çehreli wrote: >> >> ... Object orientation don't go well with collections > > On what basis do you make that assertion? You stripped my answer. > i.e. Which aspect of OOP programming 'don't

Re: Is there such concept of a list in D?

2022-12-13 Thread areYouSureAboutThat via Digitalmars-d-learn
On Saturday, 10 December 2022 at 15:59:07 UTC, Ali Çehreli wrote: ... Object orientation don't go well with collections On what basis do you make that assertion? i.e. Which aspect of OOP programming 'don't go well with collections'? Is it encapsulation? Is it inheritance? Is it

Re: Is there such concept of a list in D?

2022-12-13 Thread ryuukk_ via Digitalmars-d-learn
On Monday, 12 December 2022 at 07:57:28 UTC, TTK Ciar wrote: On Sunday, 11 December 2022 at 17:45:20 UTC, ryuukk_ wrote: Why is it called ``DList`` and not just ``List``, i have no clue Probably because it is a *D*ouble-linked List :-) oh right, thanks, i never used that module before i

Re: Is there such concept of a list in D?

2022-12-12 Thread Gregor Mückl via Digitalmars-d-learn
On Sunday, 11 December 2022 at 17:45:20 UTC, ryuukk_ wrote: There is: https://dlang.org/phobos/std_container_dlist.html Why is it called ``DList`` and not just ``List``, i have no clue The D is to indicate that it is a doubly-linked list. It maintains a forward and backward pointer chain to

Re: Is there such concept of a list in D?

2022-12-12 Thread TTK Ciar via Digitalmars-d-learn
On Sunday, 11 December 2022 at 17:45:20 UTC, ryuukk_ wrote: Why is it called ``DList`` and not just ``List``, i have no clue Probably because it is a *D*ouble-linked List :-)

Re: Is there such concept of a list in D?

2022-12-11 Thread ryuukk_ via Digitalmars-d-learn
On Saturday, 10 December 2022 at 05:46:26 UTC, thebluepandabear wrote: In most languages there is some sort of `List` type, is that the same for D? There is: https://dlang.org/phobos/std_container_dlist.html Why is it called ``DList`` and not just ``List``, i have no clue

Re: Is there such concept of a list in D?

2022-12-11 Thread zjh via Digitalmars-d-learn
On Sunday, 11 December 2022 at 07:47:35 UTC, Salih Dincer wrote: .. Thank you for your reply. I think if you take `random` values frequently, you'd better use `'array'`,am I right?

Re: Is there such concept of a list in D?

2022-12-10 Thread Salih Dincer via Digitalmars-d-learn
On Sunday, 11 December 2022 at 03:13:17 UTC, zjh wrote: On Saturday, 10 December 2022 at 19:49:23 UTC, Salih Dincer wrote: SDB@79 Can the `range` be partially traversed? That is, suppose we only access the `[3,5)` elements? Certainly, there are many ways to do this. For example: ```d

Re: Is there such concept of a list in D?

2022-12-10 Thread zjh via Digitalmars-d-learn
On Saturday, 10 December 2022 at 19:49:23 UTC, Salih Dincer wrote: SDB@79 Can the `range` be partially traversed? That is, suppose we only access the `[3,5)` elements?

Re: Is there such concept of a list in D?

2022-12-10 Thread Salih Dincer via Digitalmars-d-learn
On Saturday, 10 December 2022 at 05:46:26 UTC, thebluepandabear wrote: In most languages there is some sort of `List` type, is that the same for D? The standard library has many possibilities, including linked lists. What about the news from the range... In D, the concept of range is very

Re: Is there such concept of a list in D?

2022-12-10 Thread Ali Çehreli via Digitalmars-d-learn
On 12/9/22 22:11, thebluepandabear wrote: > I was wondering more if there is an object oriented way of creating > arrays, Every collection has its own special interface. Object orientation don't go well with collections. For example, you wouldn't want indexing operator for a linked list. >

Re: Is there such concept of a list in D?

2022-12-09 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/10/22 1:11 AM, thebluepandabear wrote: I was wondering more if there is an object oriented way of creating arrays, like in Java there is an `ArrayList`, in C++ there is `std::vector`, etc. In D, you just use `T[]` for an array, it's similar to `std::vector`. -Steve

Re: Is there such concept of a list in D?

2022-12-09 Thread thebluepandabear via Digitalmars-d-learn
On Saturday, 10 December 2022 at 05:54:09 UTC, Steven Schveighoffer wrote: On 12/10/22 12:46 AM, thebluepandabear wrote: In most languages there is some sort of `List` type, is that the same for D? D doesn't focus on interfaces, we have concepts, like ranges. Sorry, it's hard to answer your

Re: Is there such concept of a list in D?

2022-12-09 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/10/22 12:46 AM, thebluepandabear wrote: In most languages there is some sort of `List` type, is that the same for D? D doesn't focus on interfaces, we have concepts, like ranges. Sorry, it's hard to answer your question without asking more questions: are you looking for a linked list?