From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: babel results handling Date: Wed, 03 Apr 2013 08:18:09 -0600 Message-ID: <87r4irwsoy.fsf@gmail.com> References: <20130329014615.GA49671@BigDog.local> <87wqsq6yd1.fsf@gmail.com> <20130329214238.GA53401@BigDog.local> <87r4ixah7y.fsf@gmail.com> <20130330234151.GA53721@BigDog.local> <87mwtkqtzh.fsf@gmail.com> <20130331122900.GA57939@BigDog.local> <87ip47r8pp.fsf@gmail.com> <20130401162204.GA89231@BigDog.local> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:37782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNPQU-0002Sq-Cj for emacs-orgmode@gnu.org; Wed, 03 Apr 2013 11:16:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNPQR-0007rk-EQ for emacs-orgmode@gnu.org; Wed, 03 Apr 2013 11:16:38 -0400 Received: from mail-da0-x236.google.com ([2607:f8b0:400e:c00::236]:47386) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNPQQ-0007rM-Ux for emacs-orgmode@gnu.org; Wed, 03 Apr 2013 11:16:35 -0400 Received: by mail-da0-f54.google.com with SMTP id p1so711047dad.13 for ; Wed, 03 Apr 2013 08:16:34 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Rick Frankel writes: > On Sun, Mar 31, 2013 at 07:37:38AM -0600, Eric Schulte wrote: >> It is certainly true that Emacs Lisp is treated differently than all >> other languages. There are also significant differences between >> languages, e.g., session evaluation doesn't make sense for some >> languages, and for other languages session evaluation is the only type >> of evaluation that does make sense. >> >> In addition to that, with over 40 supported languages [1], There >> undoubtedly are cases where we are doing a bad job of ensuring >> inter-languages consistency. If you can find concise examples which use >> demonstrate significant inconsistencies between languages, then we >> should be able to resolve those on a case by case basis. In general I >> think ob-sh is probably the most widely used code block language, and >> can be treated as the gold standard against which other languages should >> be compared. > > `sh' is probably not the best choice as a "gold standard" due to the > fact that it only supports STDOUT ("output" and not "value"). > > Many of the languages are obviously not general purpose, or do not > support (like shell), wrapped values (only STDOUT), or don't generate > text, so consistency does not matter (e.g., css, sass, sql, sqlite, > plantuml, dot). > > Regardless, the attached org file is a first step an comparing the > result processing of some languages (specifically, sh, emacs-lisp, > perl and ruby), which, I think, covers a good portion of the babel use > of general purpose languages. > This is a great file. Thanks for generating it and sharing it. Although I think it would be more useful if languages were the smallest scale of organization rather than the largest to make cross-language comparison easier. Would it be difficult to add another set of code blocks which automatically compare the output of these automatically generated code blocks, indicating when there are differences. > > The upshot, is that perl value results match shell value/output > results and emacs-lisp, python and ruby all return about the same > results (elisp returns the quote characters from a verbatim string). > What are the perl-shell vs. python-ruby-elisp differences? > > I still think that the scalar pipe-delimited processing from shell and > perl is wrong in that pipe-delimited data ends up w/ an extra column > if each line starts w/ a pipe, but not if the pipe is used like a > csv separator (between columns but not at the beginning or end of the > line). > If you want to use pipes to delimit data, then I'd suggest *not* interpreting the data as a value, but rather doing something like ":results verbatim drawer". Generally pipes aren't considered to be table column delimiters, I'd try tabs or spaces instead. > > Also, looking at the manual > (http://orgmode.org/manual/results.html#results) vs. the code, are > there are actually four classes of :results arguments with type broken > into type and format? > > - Type :: (file list vector table scalar verbatim) > - Format :: (raw html latex org code pp drawer) > Yes, this does seem to be more clear. If you're willing to supply a documentation patch I'd be very happy to apply it. Thanks! -- Eric Schulte http://cs.unm.edu/~eschulte