From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pascal Fleury Subject: Re: Export arrays for 'sh' code blocks when using bash Date: Mon, 7 Apr 2014 01:25:19 +0200 Message-ID: References: <871txn1qni.fsf@bagel.gateway.pace.com> <871txkff89.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a11c1d7186dcf8904f66810f6 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WWwRL-0005Ra-7W for emacs-orgmode@gnu.org; Sun, 06 Apr 2014 19:25:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WWwRF-0001tl-Td for emacs-orgmode@gnu.org; Sun, 06 Apr 2014 19:25:27 -0400 Received: from mail-yk0-f170.google.com ([209.85.160.170]:35127) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WWwRF-0001rP-N6 for emacs-orgmode@gnu.org; Sun, 06 Apr 2014 19:25:21 -0400 Received: by mail-yk0-f170.google.com with SMTP id 9so4877632ykp.15 for ; Sun, 06 Apr 2014 16:25:19 -0700 (PDT) In-Reply-To: <871txkff89.fsf@gmail.com> 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: Eric Schulte Cc: Pascal Fleury , emacs-orgmode@gnu.org --001a11c1d7186dcf8904f66810f6 Content-Type: multipart/alternative; boundary=001a11c1d7186dcf8404f66810f4 --001a11c1d7186dcf8404f66810f4 Content-Type: text/plain; charset=UTF-8 Hi Eric, Please find attached a new patch that contains the same changes of the ob-shell.el exporter as before, but also contains unit tests for checking that it works. Let me know if you need some changes in there, and how the google-wide copyright issues comes along. My information came from Chris DiBona (our master of open-source licenses), is this helps to find the relevant documents. Thanks, Pascal On Sat, Mar 29, 2014 at 8:37 PM, Eric Schulte wrote: > Thanks for making these changes. Once they're in and Bastien figures > out how the google-wide copyright attribution works we should be good to > go. > > Thanks! > > Pascal Fleury writes: > > > Hi Eric, see comments inline. > > > > > > On Thu, Mar 27, 2014 at 6:43 PM, Eric Schulte >wrote: > > > >> Hi Pascal, > >> > >> This looks like a good patch. If I could make three changes/requests. > >> > >> > > Thanks, I am happy to see it makes sense. > > > > > >> 1. This patch should also work for "begin_src bash" code blocks. After > >> a very quick glance it doesn't appear to. > >> > >> I have actually tried this with the latest org-mode release (8.2.5h) and > > it did plainly not accept 'begin_src bash'. Maybe that's new with the > > ob-shell.el (I noticed it has been renamed :-) > > > > > >> 2. Could you include one or two tests ensuring that this patch does what > >> it intends with bash code blocks, and does not affect code blocks > >> executed with bin/sh? > >> > > > > Will do, seeing it has some traction. > > > > > >> > >> 3. Large contributions like this require some FSF paperwork. Please see > >> the following page for information on requirements to contribute. > >> > >> > > I checked internally, and apparently, Google has already such a signed > > document. It would run on the same document, as I am a google employee. > > > > > >> http://orgmode.org/worg/org-contribute.html > >> > >> Thanks, and I look forward to seeing this merged into Org-mode! > >> Eric > >> > >> Pascal Fleury writes: > >> > >> > Hello, > >> > > >> > I'dl like to propose a patch for inclusion into org-mode (ob-shell.el > in > >> > particular). > >> > > >> > *TL;DR:* use arrays and associative arrays when exporting variables to > >> bash > >> > in 'sh' code blocks. > >> > > >> > *Details:* > >> > When variables are defined in a 'sh' code block, they are exported as > >> > strings. when the variable itself is an array or a table, then we > simply > >> > get a shell variable that contains the list of all values in a > >> > non-structured form. E.g. > >> > > >> > #+NAME: my_list > >> > | one | > >> > | two | > >> > | three | > >> > > >> > #+NAME: experiment > >> > | name | first_attempt | > >> > | date | [2014-03-27 Thu] | > >> > | user | fleury | > >> > > >> > #+BEGIN_SRC sh :var scalar="some value" :var array=my_list :var > >> table=config > >> > echo ${scalar} # -> prints 'some value' > >> > echo ${array} # -> prints 'one two three' > >> > echo ${table} # -> prints 'first attempt [2014-03-27 Thu] fleury' > >> > #+END_SRC > >> > > >> > This will print simple strings. Also, there is no easy way to access > the > >> > date of the experiment, for example. Now bash has things like arrays > and > >> > associative arrays, but the current ob-shell.el does not use these. > >> > Probably because their syntax is bash-specific, and ob-shell.el is > >> > shell-agnostic. > >> > > >> > My patch (attached) changes this in the case you have > >> > (setq org-babel-sh-command "bash") > >> > in your emacs config somewhere. If any other value is used, it > continues > >> to > >> > export them as we do today (I don't know enough about other shells). > >> > > >> > In that case, it will export the list as an array, the table as an > >> > associative array, and the scalar as it does already. So the 'sh' code > >> > block could then use > >> > > >> > #+BEGIN_SRC sh :var scalar="some value" :var array=my_list :var > >> table=config > >> > echo ${scalar} > >> > echo ${array[1]} # -> prints "two" > >> > echo ${table[user]} # -> prints "fleury" > >> > #+END_SRC > >> > > >> > In the case we have a bigger table, then the first row is used as key, > >> the > >> > others are represented as a string with all the values (as it is for > >> array > >> > currently). bash does not have multi-dimensional arrays, so it needs > to > >> be > >> > a string. > >> > > >> > This makes writing shell snippets much easier in my experience, and > there > >> > I'd like to propose this fix for the org-mode community at large. > >> > > >> > --paf > >> > > >> > diff --git a/lisp/ob-shell.el b/lisp/ob-shell.el > >> > index 3ede701..0a691e2 100644 > >> > --- a/lisp/ob-shell.el > >> > +++ b/lisp/ob-shell.el > >> > @@ -106,6 +106,30 @@ This function is called by > >> `org-babel-execute-src-block'." > >> > > >> > ;; helper functions > >> > > >> > +(defun org-babel-variable-assignments:bash_array (varname values > >> &optional sep hline) > >> > + "Returns a list of statements declaring the values as a bash > array." > >> > + (format "declare -a %s=( \"%s\" )" > >> > + varname > >> > + (mapconcat 'identity > >> > + (mapcar > >> > + (lambda (value) (org-babel-sh-var-to-sh value sep hline)) > >> > + values) > >> > + "\" \""))) > >> > + > >> > +(defun org-babel-variable-assignments:bash_associative (varname > values > >> &optional sep hline) > >> > + "Returns a list of statements declaring the values as bash > >> associative array." > >> > + (format "declare -A %s\n%s" > >> > + varname > >> > + (mapconcat 'identity > >> > + (mapcar > >> > + (lambda (items) > >> > + (format "%s[\"%s\"]=%s" > >> > + varname > >> > + (org-babel-sh-var-to-sh (car items) sep hline) > >> > + (org-babel-sh-var-to-sh (cdr items) sep hline))) > >> > + values) > >> > + "\n"))) > >> > + > >> > (defun org-babel-variable-assignments:sh (params) > >> > "Return list of shell statements assigning the block's variables." > >> > (let ((sep (cdr (assoc :separator params))) > >> > @@ -114,9 +138,17 @@ This function is called by > >> `org-babel-execute-src-block'." > >> > "hline")))) > >> > (mapcar > >> > (lambda (pair) > >> > - (format "%s=%s" > >> > - (car pair) > >> > - (org-babel-sh-var-to-sh (cdr pair) sep hline))) > >> > + (if (and (string= org-babel-sh-command "bash") (listp (cdr > >> pair))) > >> > + (if (listp (car (cdr pair))) > >> > + (org-babel-variable-assignments:bash_associative > >> > + (car pair) (cdr pair) sep hline) > >> > + (org-babel-variable-assignments:bash_array > >> > + (car pair) (cdr pair) sep) hline) > >> > + (format "%s=%s" > >> > + (car pair) > >> > + (org-babel-sh-var-to-sh (cdr pair) sep hline)) > >> > + ) > >> > + ) > >> > (mapcar #'cdr (org-babel-get-header params :var))))) > >> > > >> > (defun org-babel-sh-var-to-sh (var &optional sep hline) > >> > >> -- > >> Eric Schulte > >> https://cs.unm.edu/~eschulte > >> PGP: 0x614CA05D > >> > > -- > Eric Schulte > https://cs.unm.edu/~eschulte > PGP: 0x614CA05D > > --001a11c1d7186dcf8404f66810f4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Eric,

Please find attached a new pat= ch that contains the same changes of the ob-shell.el exporter as before, bu= t also contains unit tests for checking that it works.

Let me know if you need some changes in there, and how the google-wide= copyright issues comes along. My information came from Chris DiBona (our m= aster of open-source licenses), is this helps to find the relevant document= s.

Thanks,
Pascal



On Sat, Mar 29, 2= 014 at 8:37 PM, Eric Schulte <schulte.eric@gmail.com> w= rote:
Thanks for making these changes. =C2=A0Once = they're in and Bastien figures
out how the google-wide copyright attribution works we should be good to go.

Thanks!

Pascal Fleury <fleury@google.com> writes:

> Hi Eric, see comments inline.
>
>
> On Thu, Mar 27, 2014 at 6:43 PM, Eric Schulte <
schulte.eric@gmail.com>wrote:
>
>> Hi Pascal,
>>
>> This looks like a good patch. =C2=A0If I could make three changes/= requests.
>>
>>
> Thanks, I am happy to see it makes sense.
>
>
>> 1. This patch should also work for "begin_src bash" code= blocks. =C2=A0After
>> =C2=A0 =C2=A0a very quick glance it doesn't appear to.
>>
>> I have actually tried this with the latest org-mode release (8.2.5= h) and
> it did plainly not accept 'begin_src bash'. Maybe that's n= ew with the
> ob-shell.el (I noticed it has been renamed :-)
>
>
>> 2. Could you include one or two tests ensuring that this patch doe= s what
>> =C2=A0 =C2=A0it intends with bash code blocks, and does not affect= code blocks
>> =C2=A0 =C2=A0executed with bin/sh?
>>
>
> Will do, seeing it has some traction.
>
>
>>
>> 3. Large contributions like this require some FSF paperwork. =C2= =A0Please see
>> =C2=A0 =C2=A0the following page for information on requirements to= contribute.
>>
>>
> I checked internally, and apparently, Google has already such a signed=
> document. It would run on the same document, as I am a google employee= .
>
>
>> =C2=A0 =C2=A0http://orgmode.org/worg/org-contribute.html
>>
>> Thanks, and I look forward to seeing this merged into Org-mode! >> Eric
>>
>> Pascal Fleury <fleury@goog= le.com> writes:
>>
>> > Hello,
>> >
>> > I'dl like to propose a patch for inclusion into org-mode = (ob-shell.el in
>> > particular).
>> >
>> > *TL;DR:* use arrays and associative arrays when exporting var= iables to
>> bash
>> > in 'sh' code blocks.
>> >
>> > *Details:*
>> > When variables are defined in a 'sh' code block, they= are exported as
>> > strings. when the variable itself is an array or a table, the= n we simply
>> > get a shell variable that contains the list of all values in = a
>> > non-structured form. E.g.
>> >
>> > #+NAME: my_list
>> > | one =C2=A0 |
>> > | two =C2=A0 |
>> > | three |
>> >
>> > #+NAME: experiment
>> > | name | first_attempt =C2=A0 =C2=A0|
>> > | date | [2014-03-27 Thu] |
>> > | user | fleury =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |
>> >
>> > #+BEGIN_SRC sh :var scalar=3D"some value" :var arra= y=3Dmy_list :var
>> table=3Dconfig
>> > echo ${scalar} =C2=A0# -> prints 'some value'
>> > echo ${array} =C2=A0 # -> prints 'one two three' >> > echo ${table} =C2=A0 # -> prints 'first attempt [2014-= 03-27 Thu] fleury'
>> > #+END_SRC
>> >
>> > This will print simple strings. Also, there is no easy way to= access the
>> > date of the experiment, for example. Now bash has things like= arrays and
>> > associative arrays, but the current ob-shell.el does not use = these.
>> > Probably because their syntax is bash-specific, and ob-shell.= el is
>> > shell-agnostic.
>> >
>> > My patch (attached) changes this in the case you have
>> > (setq org-babel-sh-command "bash")
>> > in your emacs config somewhere. If any other value is used, i= t continues
>> to
>> > export them as we do today (I don't know enough about oth= er shells).
>> >
>> > In that case, it will export the list as an array, the table = as an
>> > associative array, and the scalar as it does already. So the = 'sh' code
>> > block could then use
>> >
>> > #+BEGIN_SRC sh :var scalar=3D"some value" :var arra= y=3Dmy_list :var
>> table=3Dconfig
>> > echo ${scalar}
>> > echo ${array[1]} # -> prints "two"
>> > echo ${table[user]} # -> prints "fleury"
>> > #+END_SRC
>> >
>> > In the case we have a bigger table, then the first row is use= d as key,
>> the
>> > others are represented as a string with all the values (as it= is for
>> array
>> > currently). bash does not have multi-dimensional arrays, so i= t needs to
>> be
>> > a string.
>> >
>> > This makes writing shell snippets much easier in my experienc= e, and there
>> > I'd like to propose this fix for the org-mode community a= t large.
>> >
>> > --paf
>> >
>> > diff --git a/lisp/ob-shell.el b/lisp/ob-shell.el
>> > index 3ede701..0a691e2 100644
>> > --- a/lisp/ob-shell.el
>> > +++ b/lisp/ob-shell.el
>> > @@ -106,6 +106,30 @@ This function is called by
>> `org-babel-execute-src-block'."
>> >
>> > =C2=A0;; helper functions
>> >
>> > +(defun org-babel-variable-assignments:bash_array (varname va= lues
>> &optional sep hline)
>> > + =C2=A0"Returns a list of statements declaring the valu= es as a bash array."
>> > + =C2=A0(format "declare -a %s=3D( \"%s\" )&qu= ot;
>> > + =C2=A0 =C2=A0 varname
>> > + =C2=A0 =C2=A0 (mapconcat 'identity
>> > + =C2=A0 =C2=A0 =C2=A0 (mapcar
>> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 (lambda (value) (org-babel-sh-v= ar-to-sh value sep hline))
>> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 values)
>> > + =C2=A0 =C2=A0 =C2=A0 "\" \"")))
>> > +
>> > +(defun org-babel-variable-assignments:bash_associative (varn= ame values
>> &optional sep hline)
>> > + =C2=A0"Returns a list of statements declaring the valu= es as bash
>> associative array."
>> > + =C2=A0(format "declare -A %s\n%s"
>> > + =C2=A0 =C2=A0varname
>> > + =C2=A0 =C2=A0(mapconcat 'identity
>> > + =C2=A0 =C2=A0 =C2=A0(mapcar
>> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0(lambda (items)
>> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(format "%s[\"%= s\"]=3D%s"
>> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0varname
>> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(org-babel-sh-var-= to-sh (car items) sep hline)
>> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(org-babel-sh-var-= to-sh (cdr items) sep hline)))
>> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0values)
>> > + =C2=A0 =C2=A0 =C2=A0"\n")))
>> > +
>> > =C2=A0(defun org-babel-variable-assignments:sh (params)
>> > =C2=A0 =C2=A0"Return list of shell statements assigning = the block's variables."
>> > =C2=A0 =C2=A0(let ((sep (cdr (assoc :separator params)))
>> > @@ -114,9 +138,17 @@ This function is called by
>> `org-babel-execute-src-block'."
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0"hline"))))
>> > =C2=A0 =C2=A0 =C2=A0(mapcar
>> > =C2=A0 =C2=A0 =C2=A0 (lambda (pair)
>> > - =C2=A0 =C2=A0 =C2=A0 (format "%s=3D%s"
>> > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(car pair)
>> > - =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(org-babel-sh-var-= to-sh (cdr pair) sep hline)))
>> > + =C2=A0 =C2=A0 =C2=A0 (if (and (string=3D org-babel-sh-comma= nd "bash") (listp (cdr
>> pair)))
>> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (listp (car (cdr pair))) >> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-babel-variable-assi= gnments:bash_associative
>> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (car pair) (cdr pair) se= p hline)
>> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-babel-variable-assi= gnments:bash_array
>> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (car pair) (cdr pair) se= p) hline)
>> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 (format "%s=3D%s"
>> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 (car pair)
>> > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 (org-babel-sh-var-to-sh (cdr pa= ir) sep hline))
>> > + =C2=A0 =C2=A0 =C2=A0 )
>> > + =C2=A0 =C2=A0 )
>> > =C2=A0 =C2=A0 =C2=A0 (mapcar #'cdr (org-babel-get-header = params :var)))))
>> >
>> > =C2=A0(defun org-babel-sh-var-to-sh (var &optional sep hl= ine)
>>
>> --
>> Eric Schulte
>> https:/= /cs.unm.edu/~eschulte
>> PGP: 0x614CA05D
>>

--
Eric Schulte
https://cs.unm.e= du/~eschulte
PGP: 0x614CA05D


--001a11c1d7186dcf8404f66810f4-- --001a11c1d7186dcf8904f66810f6 Content-Type: text/x-patch; charset=US-ASCII; name="bash-arrays_with_test.patch" Content-Disposition: attachment; filename="bash-arrays_with_test.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_htoyk4af0 ZGlmZiAtLWdpdCBhL2xpc3Avb2Itc2hlbGwuZWwgYi9saXNwL29iLXNoZWxsLmVsCmluZGV4IDNl ZGU3MDEuLmQ3ZjE4MDIgMTAwNjQ0Ci0tLSBhL2xpc3Avb2Itc2hlbGwuZWwKKysrIGIvbGlzcC9v Yi1zaGVsbC5lbApAQCAtMTA1LDYgKzEwNSw0NCBAQCBUaGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCBi eSBgb3JnLWJhYmVsLWV4ZWN1dGUtc3JjLWJsb2NrJy4iCiAgICAgICBidWZmZXIpKSkKIAogOzsg aGVscGVyIGZ1bmN0aW9ucworKGRlZnVuIG9yZy1iYWJlbC12YXJpYWJsZS1hc3NpZ25tZW50czpn ZW5lcmljICh2YXJuYW1lIHZhbHVlcyAmb3B0aW9uYWwgc2VwIGhsaW5lKQorICAiUmV0dXJucyBh IGxpc3Qgb2Ygc3RhdGVtZW50cyBkZWNsYXJpbmcgdGhlIHZhbHVlcyBhcyBhIGdlbmVyaWMgdmFy aWFibGUuIgorICAoZm9ybWF0ICIlcz0lcyIgdmFybmFtZSAob3JnLWJhYmVsLXNoLXZhci10by1z aCB2YWx1ZXMgc2VwIGhsaW5lKSkpCisKKyhkZWZ1biBvcmctYmFiZWwtdmFyaWFibGUtYXNzaWdu bWVudHM6YmFzaF9hcnJheSAodmFybmFtZSB2YWx1ZXMgJm9wdGlvbmFsIHNlcCBobGluZSkKKyAg IlJldHVybnMgYSBsaXN0IG9mIHN0YXRlbWVudHMgZGVjbGFyaW5nIHRoZSB2YWx1ZXMgYXMgYSBi YXNoIGFycmF5LiIKKyAgKGZvcm1hdCAidW5zZXQgJXNcbmRlY2xhcmUgLWEgJXM9KCBcIiVzXCIg KSIKKyAgICAgdmFybmFtZSB2YXJuYW1lCisgICAgIChtYXBjb25jYXQgJ2lkZW50aXR5CisgICAg ICAgKG1hcGNhc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