Which... is kind of the point of the Knuth solution here. It was a pedagogical exercise. As much to show how literate programs can be presented as it was to "solve" the stated problem.
Edit: It occurs to me you could be referring to the pipeline version. Which, yeah, I don't think that really changes my post. :D. The final paragraph would be changed to the point of the Milroy's code is to get the answer, not to have a library function that is expected to be used again and again on input.
Re:More shell, less egg (2011)
by tyingq on Sunday June 04, 2023 @08:06PM
(#36190773)
Yes, I was talking about the pipeline version. Last time this came up, I tried a simple perl script[1] and it was quite a lot faster than the pipeline. Even without using a heap to further limit the sorting.
That said https://www.amazon.com/Exercises-Programming-Style-Cristina-... is a good sized book that is nothing but takes on this program from different styles. It is amusing how far you can take that.
Which... is kind of the point of the Knuth solution here. It was a pedagogical exercise. As much to show how literate programs can be presented as it was to "solve" the stated problem.
Edit: It occurs to me you could be referring to the pipeline version. Which, yeah, I don't think that really changes my post. :D. The final paragraph would be changed to the point of the Milroy's code is to get the answer, not to have a library function that is expected to be used again and again on input.