Dan Davison <dandavis...@gmail.com> writes:

>
> Incidentally, I have for a long time wondered whether we should permit
> src blocks to read *input data* from standard input. This would require
> altering ob-eval such that the src block body is read from file. Then we
> could do things like
>
> #+source: output-some-text
> #+begin_src sh :results output
>   # print stuff
> #+end_src
>
> #+begin_src perl :stdin output-some-text
>   while ( <> ) {
>       # process the text
>   }
> #+end_src
>

This is interesting, it would involve starting all such pipe-chained
blocks at the same time, and coordinating their input and output through
Unix pipes (note: I don't know how pipes would work on a Windows
machine).

One question is whether we allow data to pass /directly/ between blocks,
or if we insert babel in between to do its usual parsing (i.e. arrays
into elisp lists, etc...).  I'd lean against inserting babel as I
believe this would be of use mainly for performance, and Emacs/Babel
parsing would blow any performance gains.  Also it could be difficult to
implement.

I think that in addition to the :stdin option above we would need a
=:stdout= option would imply both =:results output= and =:results
scalar= and would allow the process to write intermediate results
directly to a supplied pipe.  Perhaps such a :stdout option would never
be supplied directly by the user, but would rather be used by babel to
organize piping when that code block has referenced by another code
block using :stdin.

Does the above make sense or sound appealing?

Best -- Eric

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to