emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Eric Schulte" <schulte.eric@gmail.com>
To: Dan Davison <dandavison7@gmail.com>
Cc: Eric S Fraga <ucecesf@ucl.ac.uk>, emacs-orgmode@gnu.org
Subject: Re: [Babel] Piping between code blocks Was: Handling of errors when using Ledger
Date: Sat, 27 Nov 2010 15:04:46 -0700	[thread overview]
Message-ID: <87d3pqh18h.fsf_-_@gmail.com> (raw)
In-Reply-To: <87vd3kxq69.fsf@gmail.com> (Dan Davison's message of "Fri, 26 Nov 2010 11:47:10 +0000")

Dan Davison <dandavison7@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

      parent reply	other threads:[~2010-11-27 22:04 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-07 11:55 [Babel] Handling of errors when using Ledger Sébastien Vauban
2010-10-07 13:36 ` Dan Davison
2010-10-12 19:58   ` Sébastien Vauban
2010-10-13  8:04     ` Eric S Fraga
2010-11-25 16:32       ` Dan
2010-11-25 19:59         ` Bernt Hansen
2010-11-25 21:00           ` [OT] retrieving old messages [WAS] " Dan Davison
2010-11-26  0:19             ` [OT] retrieving old messages Bernt Hansen
2010-11-29  2:34             ` [OT] retrieving old messages [WAS] Re: [Babel] Handling of errors when using Ledger Matt Lundin
2010-11-29  9:14               ` [OT] retrieving old messages Sébastien Vauban
2010-11-29 14:11                 ` Matt Lundin
2010-11-25 21:13           ` [Babel] Handling of errors when using Ledger Sébastien Vauban
2010-11-25 20:03         ` Sébastien Vauban
2010-11-26  8:34         ` Eric S Fraga
2010-11-26 11:47           ` Dan Davison
2010-11-26 12:39             ` Eric S Fraga
2010-12-23 10:28               ` Dan Davison
2010-12-23 15:52                 ` Sébastien Vauban
2010-12-23 19:07                 ` Eric S Fraga
2011-03-05  0:29                   ` Dan Davison
2011-03-07  9:11                     ` Eric S Fraga
2010-11-27 22:04             ` Eric Schulte [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d3pqh18h.fsf_-_@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=dandavison7@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=ucecesf@ucl.ac.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).