Dear list,
I have problems with exploiting programatically the structure of an Org table :
I want to write function acting on complex tables, where the original information is presented along various statistics. My idea is to isolate the original information in a range delimited (by convention) by the first and second hlines and by the first and last columns ; the function should accept the whole table and retrieve the original data. The point is that the function should accept a variable number of lines in both the "original data" range and the summary information.
Let ttest such a table with hlines :
#+name: ttest
| ttest | c1 | c2 | rSum |
|-------+----+----+------|
|     3 |  3 |  5 |    8 |
|     8 |  8 | 12 |   20 |
|-------+----+----+------|
|  cSum | 11 | 17 |   28 |
#+TBLFM: @>$2..@>$>=vsum(@I..@II)::@2..@>>$4=vsum($<<..$>>)
ttestc1c2rSum
3358
881220
cSum111728
Passing this table as an argument to source code loses the hlines :
#+begin_src emacs-lisp :exports results :results drawer :var foo=ttest
  foo
#+end_src
((ttest c1 c2 rSum) (3 3 5 8) (8 8 12 20) (cSum 11 17 28))
The structure allowing to retrieve the original data is lost.
The point is that the source code can't exploit the hlines to find relevant information (in the present case, the lines between the hlines).
Alternatively, one may try and pass the relevant range, using foo=(org-table-get-remote-range "ttest" "@I$<<..@II$>>") as an argument. This fails for a different reason :
#+begin_src emacs-lisp :exports results :results drawer :var foo=(org-table-get-remote-range "ttest" "@I$<<..@II$>>")
  foo
#+end_src
(3 5 8 12)
Again, the structure is lost : this time, foo is a "flattened" vector, whose matricial shape is lost to the processing function.
I am looking for explanations and/or hints.

Attached : the source of the present mail.

Thanks in advance...

--
Emmanuel Charpentier