Ancestors

Toot

Written by Daniel Barlow on 2025-01-20 at 15:43

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

Descendants

Written by samueldr on 2025-01-20 at 18:48

@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

Written by Daniel Barlow on 2025-01-20 at 18:57

@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

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113861446567443355
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
271.481051 milliseconds
Gemini-to-HTML Time
0.895736 milliseconds

This content has been proxied by September (3851b).