can multi children as type map? #45

Closed
opened 2017-02-03 15:41:43 +00:00 by QuestionPython · 3 comments
QuestionPython commented 2017-02-03 15:41:43 +00:00 (Migrated from github.com)

hi can multi children as type map? example :

map["name":"test",5:456123123,[1:5,2:7,3:["name":"ttt","age":48]]]

hi can multi children as type map? example : >map["name":"test",5:456123123,[1:5,2:7,3:["name":"ttt","age":48]]]
emirpasic commented 2017-03-05 21:56:46 +00:00 (Migrated from github.com)

@questionpython sorry, I didn't understand what you meant. Are you talking about multi-maps?

@questionpython sorry, I didn't understand what you meant. Are you talking about multi-maps?
QuestionPython commented 2017-03-19 02:03:11 +00:00 (Migrated from github.com)

example :

[   1,2,3,4,5,  [9,8,7,   [6,4,1,2   ]   ,9   ]   ,4,0,0   ]
example : ``` [ 1,2,3,4,5, [9,8,7, [6,4,1,2 ] ,9 ] ,4,0,0 ] ```
emirpasic commented 2017-03-19 16:24:40 +00:00 (Migrated from github.com)

@questionpython sorry, but I still don't understand your question. To me that looks like an array of elements that can either be single elements (integers) or other arrays, so I am confused about your mention of "maps".

There is nothing stopping you from doing that in GoDS as long as you type assert afterwards when fetching those elements, i.e. either it's an integer or an array. In case where the element is an array, iterate over its elements again (recursively).

Do you have a concrete example or use case of what you are trying to accomplish?

@questionpython sorry, but I still don't understand your question. To me that looks like an array of elements that can either be single elements (integers) or other arrays, so I am confused about your mention of "maps". There is nothing stopping you from doing that in GoDS as long as you type assert afterwards when fetching those elements, i.e. either it's an integer or an array. In case where the element is an array, iterate over its elements again (recursively). Do you have a concrete example or use case of what you are trying to accomplish?
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#45
No description provided.