Re: [O] Problem with src_ruby inline code and []
Hello, "Charles C. Berry"writes: > On Tue, 15 Mar 2016, William Denton wrote: > >> I was updating and exporting a file where I use Ruby to do some basic >> arithmetic on tables, and noticed that inline code blocks where I reference >> an array aren't working. >> > > ECM: > > src_ruby[:var t=sampletable]{t[2][2]} > > #+BEGIN_SRC emacs-lisp >(save-excursion > (search-backward (concat "src" "_")) > (org-element-property :value (org-element-inline-src-block-parser))) > #+END_SRC > > #+RESULTS: : t[2 Fixed. Thank you. Regards, -- Nicolas Goaziou
Re: [O] Problem with src_ruby inline code and []
On Tue, 15 Mar 2016, William Denton wrote: I was updating and exporting a file where I use Ruby to do some basic arithmetic on tables, and noticed that inline code blocks where I reference an array aren't working. ECM: src_ruby[:var t=sampletable]{t[2][2]} #+BEGIN_SRC emacs-lisp (save-excursion (search-backward (concat "src" "_")) (org-element-property :value (org-element-inline-src-block-parser))) #+END_SRC #+RESULTS: : t[2 HTH, Chuck
[O] Problem with src_ruby inline code and []
I was updating and exporting a file where I use Ruby to do some basic arithmetic on tables, and noticed that inline code blocks where I reference an array aren't working. If you C-c C-c on this simple src_ruby example you get the results. src_ruby{1 + 2} {{{results(=3=)}}} But this doesn't work: #+NAME: sampletable | name | one | two | | Me | 5 | 3 | | You | 4 | 6 | src_ruby[:var t=sampletable]{t[2][2]} It changes the line to src_ruby[:var t=sampletable]{t[2] {{{results(==)}}}[2]} and says: -:5: syntax error, unexpected keyword_end, expecting ']' -:7: syntax error, unexpected end-of-input, expecting keyword_end However, this does work: #+BEGIN_SRC ruby :var t=sampletable t[2][2] #+END_SRC #+RESULTS: : 6 Bill -- William Denton ↔ Toronto, Canada ↔ https://www.miskatonic.org/