Status: writing ruby and wishing its Hashes worked like Lua's tables. Nothing good can come of this.
=> More informations about this toot | More toots from dan@brvt.telent.net
@dan what do you mean by "work[ing] like Lua's tables" here?
(I know Lua and Ruby quite well, and I'm interested in seeing what crimes features can be involved here... Also not doubting you that yes, indeed, those languages work differently :))
=> More informations about this toot | More toots from samueldr@ap.samueldr.com
@samueldr basically I wanted the equivalent of clojure's update-in but for it to work on Arrays as well as Hashes. Hash#dig almost does (e.g. foo.dig(:uk, :london, :e, 17, 8)) but sadly only for reads not updates, and Hash#merge has no Array equivalent
I wrote a bog-standard recursive thingy in the end and it was probably the better approach :-)
=> More informations about this toot | More toots from dan@brvt.telent.net This content has been proxied by September (3851b).Proxy Information
text/gemini