Bulk Constructors - arraylist.New(1, 2, 3, 4) #36

Closed
opened 2016-09-07 02:25:58 +00:00 by emirpasic · 6 comments
emirpasic commented 2016-09-07 02:25:58 +00:00 (Migrated from github.com)

Perhaps making New() functions of containers variadic to allow for optimized bulk insertions during initialization.

Perhaps making New() functions of containers variadic to allow for optimized bulk insertions during initialization.
Spriithy commented 2017-09-28 10:08:30 +00:00 (Migrated from github.com)

Or maybe create a new bulk constructor like so arraylist.From(1, 2, 3, 4) or arraylist.Of

Or maybe create a new bulk constructor like so `arraylist.From(1, 2, 3, 4)` or `arraylist.Of`
imdanielsp commented 2018-05-20 05:44:27 +00:00 (Migrated from github.com)

Is this something that will be implemented? I am looking for something to contribute to the Go community and this will be a really nice short project for me.

Is this something that will be implemented? I am looking for something to contribute to the Go community and this will be a really nice short project for me.
emirpasic commented 2018-05-21 11:48:11 +00:00 (Migrated from github.com)

@dsantosp12 I am looking forward to implementing this. For lists and sets it's simple, but the other structures (maps/trees) I am unsure about how to pass those values and keep the API clean. I suppose we could start with lists/sets. I am planning on spending a day or two on all these new requests

@dsantosp12 I am looking forward to implementing this. For lists and sets it's simple, but the other structures (maps/trees) I am unsure about how to pass those values and keep the API clean. I suppose we could start with lists/sets. I am planning on spending a day or two on all these new requests
imdanielsp commented 2018-05-21 12:41:59 +00:00 (Migrated from github.com)

@emirpasic cool. I can start the lists/sets if you want and make a pull request and after that we can start looking at options for maps/trees structures. If you want me to move forward, assign it to me.

@emirpasic cool. I can start the lists/sets if you want and make a pull request and after that we can start looking at options for maps/trees structures. If you want me to move forward, assign it to me.
emirpasic commented 2018-05-21 12:48:34 +00:00 (Migrated from github.com)

@dsantosp12 sure, you can start and there is already some work done by @Spriithy https://github.com/emirpasic/gods/pull/61

I hope you can use some of it. Once you implement it, create a pull request so I can add the relevant documentation.

@dsantosp12 sure, you can start and there is already some work done by @Spriithy https://github.com/emirpasic/gods/pull/61 I hope you can use some of it. Once you implement it, create a pull request so I can add the relevant documentation.
imdanielsp commented 2018-05-25 14:32:05 +00:00 (Migrated from github.com)

Will do this weekend!

Will do this weekend!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
golibs/gms-gods#36
No description provided.