News for hackers. Stuff that matters.
Re:Shell Script Best Practices, from a decade of scripting t... by Macha on Thursday October 27, 2022 @12:45PM (#33360303)
In this case you're chaining discreet lookup operations where it sounds like you really want a composite key. You could easily implement this if you accepted the syntax of it as d["a.b.c"] or d["a", "b", "c"] or d.query("a", "b", "c")

Otherwise I'm not sure of a mainstream language that would let you do a.get(x).get(y) == 42 but a.get(x).get(y).get(z) == 42, unless you resorted to monkey patching the number type, as it implies 42.get(z) == 42, which seems.. silly

There are no comments on this comment yet.