all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Problem with src_ruby inline code and []
@ 2016-03-15 18:13 William Denton
  2016-03-15 21:51 ` Charles C. Berry
  0 siblings, 1 reply; 3+ messages in thread
From: William Denton @ 2016-03-15 18:13 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: TEXT/PLAIN, Size: 855 bytes --]

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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-16 17:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-15 18:13 Problem with src_ruby inline code and [] William Denton
2016-03-15 21:51 ` Charles C. Berry
2016-03-16 17:18   ` Nicolas Goaziou

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.