News for hackers. Stuff that matters.
Re:Generalizing 'jq' and Traversal Systems using optics and ... by vortico on Wednesday October 07, 2020 @03:44PM (#24711915)
Wait a second, you left out the most important part: What's in the `log(...)` function? How do you get the name of the pet and the name of the staff in that line if they have the same accessor `.name`?

That's my point. The fact that you didn't include it implies to me that it was too difficult to figure out, and a true implementation would be far more complicated, so it's not a fair comparison.

Re:Generalizing 'jq' and Traversal Systems using optics and ... by mgraczyk on Wednesday October 07, 2020 @05:11PM (#24712783)
I disagree, there are many ways to solve this problem. for example

   .company.staff | .pets | flatten | filter .type == "cat" | print(.name + " belongs to " + ..name)