Bulk Initialization #27

Closed
opened 2016-07-20 18:34:54 +00:00 by jjharr · 3 comments
jjharr commented 2016-07-20 18:34:54 +00:00 (Migrated from github.com)

It'd be nice to have a bulk initialization convenience method for the container interface. Example use case is creating a hash or set of a heavily used static data set, like country information.

It'd be nice to have a bulk initialization convenience method for the container interface. Example use case is creating a hash or set of a heavily used static data set, like country information.
emirpasic commented 2016-07-26 02:22:14 +00:00 (Migrated from github.com)

Sounds reasonable, but I'm just not sure if you need that for all container types? Most of the containers that contain only values, e.g lists, sets, have the Add function that can take multiple values. So I guess you need something similar for containers that have key-value pairs?

Sounds reasonable, but I'm just not sure if you need that for all container types? Most of the containers that contain only values, e.g lists, sets, have the Add function that can take multiple values. So I guess you need something similar for containers that have key-value pairs?
emirpasic commented 2016-08-10 11:44:49 +00:00 (Migrated from github.com)

@jjharr friendly ping.

Does the list.Add(...) function provide what you need? I gave this some more thought for the key-value pairs and I am not sure of a clean way of bulk-initializing key-value pairs. Perhaps you have some ideas?

@jjharr friendly ping. Does the list.Add(...) function provide what you need? I gave this some more thought for the key-value pairs and I am not sure of a clean way of bulk-initializing key-value pairs. Perhaps you have some ideas?
jjharr commented 2016-08-12 05:24:51 +00:00 (Migrated from github.com)

Sorry, new baby in the house and it's kind of a life-bomb.

I actually completely missed the signature for Add (facepalm).

It seems like the Go type system would make the addition of a large [interface{}]interface{} map unreasonably awkward relative to just calling Put multiple times. So... I withdraw the feature request!

Sorry, new baby in the house and it's kind of a life-bomb. I actually completely missed the signature for Add (facepalm). It seems like the Go type system would make the addition of a large [interface{}]interface{} map unreasonably awkward relative to just calling Put multiple times. So... I withdraw the feature request!
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#27
No description provided.