torch / tds

Torch C data structures
Other
80 stars 25 forks source link

request: defaultdict behavior for tds.Hash() #24

Closed willfrey closed 4 years ago

willfrey commented 7 years ago

Would this be possible by overloading some metatable functions for tds.Hash()? Or would it require diving deeper?

For reference, code to get defaultdict behavior with lua tables is available here: https://github.com/facebook/fblualib/blob/master/fblualib/util/fb/util/init.lua#L273-L278

Thanks!