From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [babel] Bugs for Emacs Lisp code blocks Date: Fri, 12 Apr 2013 16:03:08 -0600 Message-ID: <87ppxze5ku.fsf@gmail.com> References: <868v4v1x6k.fsf@somewhere.org> <871uamo4e9.fsf@gmail.com> <86d2u6z6kg.fsf@somewhere.org> <87d2u65dr1.fsf@gmail.com> <86ehek93w7.fsf@somewhere.org> <87a9p8zq7d.fsf@gmail.com> <86wqsc6rzs.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:41201) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQmdz-00014l-SB for emacs-orgmode@gnu.org; Fri, 12 Apr 2013 18:40:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQmdx-0007zV-RC for emacs-orgmode@gnu.org; Fri, 12 Apr 2013 18:40:31 -0400 Received: from mail-pd0-f170.google.com ([209.85.192.170]:63252) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQmdx-0007yv-KQ for emacs-orgmode@gnu.org; Fri, 12 Apr 2013 18:40:29 -0400 Received: by mail-pd0-f170.google.com with SMTP id 10so1633646pdi.15 for ; Fri, 12 Apr 2013 15:40:28 -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: Sebastien Vauban Cc: emacs-orgmode@gnu.org >>> >>> Much clearer, but not yet crystal-clear for me... >>> >>> Let me explain. AFAICT, there were 5 possibles values of the ":colnames" >>> header argument: >>> >>> - no header argument :: (default for all languages but Emacs Lisp) >>> - ":colnames no" :: (default for Emacs Lisp code blocks) >>> - ":colnames yes" :: Tells Org Babel that your first row contains column >>> names. >>> - ":colnames " :: Specifies to use as column names. >>> - ":colnames nil" :: Same as ":colnames yes". >>> >>> Right? >> >> Almost, values 1 (none) and 5 (nil) are the same. > > I don't share your view about this last statement. > > ** Input table > > #+name: unset-colnames-example-input > | a | b | > |---+---| > | 1 | 2 | > | 3 | 4 | > > ** Having no =3D:colnames=3D header argument (case 1) > > Same results for R and sh code blocks (first good news=C2=A0;-)) -- I'm a= voiding, > on purpose, testing with Emacs Lisp... > > #+begin_src R :var data=3Dunset-colnames-example-input > data > #+end_src > > #+results: > | 1 | 2 | > | 3 | 4 | > > #+begin_src sh :var data=3Dunset-colnames-example-input > echo "$data" > #+end_src > > #+results: > | 1 | 2 | > | 3 | 4 | > Looks good. > > ** Using =3D:colnames nil=3D header argument (case 5) > > Once again, R and sh blocks do produce the same results... > > #+begin_src R :var data=3Dunset-colnames-example-input :colnames nil > data > #+end_src > > #+results: > | a | b | > |---+---| > | 1 | 2 | > | 3 | 4 | > > #+begin_src sh :var data=3Dunset-colnames-example-input :colnames nil > echo "$data" > #+end_src > > #+results: > | a | b | > |---+---| > | 1 | 2 | > | 3 | 4 | > > ... but they are _not_ equivalent to the "no header argument" (case 1). > As I believe I mentioned "nil" on a header argument is not interpreted as the lisp literal `nil'. To pass an empty argument to a code block you should do ":colnames '()", an obscure syntax for an obscure thing. > > ** Using =3D:colnames yes=3D header argument (case 3) > > On the contrary, case 5 is equivalent to the case 3: same results as > ":colnames yes". > > #+begin_src R :var data=3Dunset-colnames-example-input :colnames yes > data > #+end_src > > #+results: > | a | b | > |---+---| > | 1 | 2 | > | 3 | 4 | > > #+begin_src sh :var data=3Dunset-colnames-example-input :colnames yes > echo "$data" > #+end_src > > #+results: > | a | b | > |---+---| > | 1 | 2 | > | 3 | 4 | > Because the "nil" you specified above is just treated as a string. You get the same thing with. #+begin_src sh :var data=3Dunset-colnames-example-input :colnames sure echo "$data" #+end_src #+RESULTS: | a | b | |---+---| | 1 | 2 | | 3 | 4 | Cheers, --=20 Eric Schulte http://cs.unm.edu/~eschulte