News for hackers. Stuff that matters.
Re:Glom – Restructured Data for Python by faitswulff on Wednesday May 09, 2018 @02:35PM (#17032529)
This is really cool. Did you ever consider an API to do the reverse - to insert a value at a particular point in the data?

My interest stems from this issue[0] on the Ruby issue tracker to make a symmetrical method to Hash#dig (which does something similar to, but more limited than glom) called Hash#bury. The problem in the issue was that inserting a value at a given index in an array proved difficult and unnatural in Ruby, so I was wondering if there were other solutions out there.

Another question occurs to me - does glom only support string keys?

[0]: https://bugs.ruby-lang.org/issues/11747

Re:Glom – Restructured Data for Python by mhashemi on Wednesday May 09, 2018 @02:39PM (#17032575)
glom not only supports more than string keys, it also supports assigning to non-dictionary objects. That's a part of the API we're working on right now, actually.

As for the data insertion, mutation may be in the future, but for now glom only transforms and returns new objects. Definitely something to think about though, bookmarked! :)

Re:Glom – Restructured Data for Python by hiccuphippo on Wednesday May 09, 2018 @09:48PM (#17035863)
Check the updateIn, mergeIn, mergeDeepIn methods in immutable.js. Maybe even asMutable, asImmutable for mutation.
Re:Glom – Restructured Data for Python by smittywerben on Sunday May 13, 2018 @05:47AM (#17058123)
Re:Glom – Restructured Data for Python by doublereedkurt on Wednesday May 09, 2018 @02:40PM (#17032587)
'string-key', T['string-key'], T[not-string-key] :-)