Should we add more common data structures?

some common data structures are not included in the standard library, such as stack, queue, and deque… slice works well but not convenient.

What are you talking about? Which package? Do you mean the standard library?

Maybe there is a 3rd party library for you here:

oops, yes, the standard library.
sure, a 3rd party library is a solution. But i don’t understand why the standard library doesn’t include these common data structures

There have been discussions about it, but you are often better off with just a slice and some methods on it.

2 Likes

I don’t find the discussions… but I may understand it now, the container list could replace the data structures I mentioned well. Thanks!

I think container/list is a good example of why more data structures don’t exist in the standard library. It’s inefficient and completely type-unsafe. Once generics are in the situation may change. Until then custom types are your friend.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.