osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Python 3.2 has some deadly infection


Steven D'Aprano <steve+comp.lang.python at pearwood.info> writes:

> On Tue, 03 Jun 2014 15:18:19 +0100, Robin Becker wrote:
>
>> Isn't it a bit old fashioned to think everything is connected to a
>> console?
>
> The whole concept of stdin and stdout is based on the idea of having a 
> console to read from and write to. Otherwise, what would be the point? 
> Classic Mac (pre OS X) had no command line interface nothing, and nothing 
> even remotely like stdin and stdout. But once you have a console, stdin, 
> stdout, and stderr become useful. And once you have them, then you can 
> extend the concept using redirection and pipes. But fundamentally, stdin 
> and stdout are about consoles.
>
We can consider "pipes" abstraction to be fundumental. Decades of usage
prove a pipeline of processes usefulness e.g.,

  tr -cs A-Za-z '\n' |
  tr A-Z a-z |
  sort |
  uniq -c |
  sort -rn |
  sed ${1}q

See http://www.leancrew.com/all-this/2011/12/more-shell-less-egg/

Whether or not a pipe is connected to a tty is a small
detail. stdin/stdout is about pipes, not consoles.


--
akira