3 ms·
Fair point. Perhaps I picked a bad example. At the same time, if you were writing a bunch of random awk-like one-offs as part of your normal lisp workflow, you
by wanorris 15y ago
Fair point. Perhaps I picked a bad example.
At the same time, if you were writing a bunch of random awk-like one-offs as part of your normal lisp workflow, you wouldn't write 4 lines of code every time, right? You sit down and write some functions or macros that condensed it into something simple that allowed you to easily specify things like a split token, one or more filter-on fields and values (or better, a filter lambda), and one or more output fields, I bet. Because it's silly to write several lines for something you do a lot.
And while you might call it process-file-and-return-matching-results or something, the interface to the result might not be so different from the line of awk in the original post.