emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jambunathan K <kjambunathan@gmail.com>
To: Herbert Sitz <hsitz@nwlink.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: org-babel -- Improper syntax error in session mode?
Date: Tue, 21 Jun 2011 02:48:18 +0530	[thread overview]
Message-ID: <818vsw19t1.fsf@gmail.com> (raw)
In-Reply-To: <loom.20110620T040229-114@post.gmane.org> (Herbert Sitz's message of "Mon, 20 Jun 2011 02:12:32 +0000 (UTC)")


Discalimer: I neither use python or babel.

> Eric Schulte <schulte.eric <at> gmail.com> writes:
>> I can confirm that I see the same behavior.  Also, if I manually type
>> the body of the code block into the session I get the same error output
>> from Python, so I don't believe this is due to a problem with Babel.
>> 
>
> It appears the problem is that the python session is interactive and
> is built to emit output after each Python "block" (e.g., the 'for'
> block), before another "block" of Python is entered.

> If this is the way it's designed 

ISTM you are speculating on design based on a very simple example and
just this "specific implementation".

> then it seems to me that it's Babel's obligation to feed the Python
> blocks to the Python session as required and then assemble the output
> pieces as appropriate.  Or am I missing something? -- Herb

There is a difference between feeding an interactive shell by hand and
feeding interactive shell via a program (The latter one is very
fast). The behaviour pertaining to buffering and flusing of output
buffers would not be apparent unless large volumes of output text is
spewed. 

The assumption that is being made in this thread is that:

"Python interpreter blocks until *all* output are *appears at the*
console before moving on to the next block."

While it is reasonable to assume that Python interpreter *flushes the
output buffers" it seems a bit too far-fetched to me to assume that
python interpreter can *guarantee" the appearance of the spewed block
before proceeding to the next block.

Unless python spec clearly and *positively* confirms the behaviour you
are assuming in *all* compliant-implementations, it is generally a good
idea to be conservative and not rely on observed behaviour too much.

Just my 2 cents. 

ps: Ignore if I have poorly understood the items discussed in this
thread.

Jambunathan K..


-- 

      parent reply	other threads:[~2011-06-20 21:17 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-19 21:54 org-babel -- Improper syntax error in session mode? Herbert Sitz
2011-06-19 23:21 ` Eric Schulte
2011-06-20  1:59   ` Herbert Sitz
2011-06-20  2:12   ` Herbert Sitz
2011-06-20  3:17     ` Nick Dokos
2011-06-20  3:46       ` Herbert Sitz
2011-06-20 19:23       ` Eric Schulte
2011-06-20 20:45         ` Herbert Sitz
2011-06-20 21:15           ` Eric Schulte
2011-06-20 23:16             ` Herbert Sitz
2011-06-21  0:08               ` Nick Dokos
2011-06-21  0:27                 ` Herbert Sitz
     [not found]                   ` <hesitz@gmail.com>
2011-06-21  1:17                     ` Nick Dokos
2011-06-21  2:19               ` Eric Schulte
2011-06-21  5:13                 ` Herbert Sitz
2011-06-21  7:15                   ` Thomas S. Dye
2011-06-21 15:35                     ` Herbert Sitz
2011-06-21 16:27                       ` Thomas S. Dye
2011-06-21 17:42                         ` Eric Schulte
2011-06-21 17:51                         ` Herbert Sitz
2011-06-21 17:52                       ` Eric Schulte
2011-06-27 18:09                         ` Herbert Sitz
2011-06-21 17:26                   ` Eric Schulte
2011-06-27 18:22                     ` Herbert Sitz
2011-06-20 21:18     ` Jambunathan K [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=818vsw19t1.fsf@gmail.com \
    --to=kjambunathan@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=hsitz@nwlink.com \
    /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).