Re:The Unix System: Making Computers Easier to Use (1982) [v...
by jude- on Monday October 13, 2014 @05:40PM
(#8450834)
Either wc needs to specifically be aware of the structure of the S-expression ls emits in order to know which atom or subtree of atoms make up words and lines, or ls must emit an S-expression with a structure that is globally mandated a priori. The former case loses generality (wc must be aware of ls's behavior), and the latter case gives wc no help in interpreting the S-expression (which is the original problem OP pointed out).
Not necessarily. You could pass S-expressions instead of bytes. Parsing would be much easier, and there would be no loss of generality.