Nicolas Goaziou <m...@nicolasgoaziou.fr> writes:

> Hello,
>
> Frederick Giasson <f...@fgiasson.com> writes:
>
>> Now, if I put a string in the format column, I al getting the following:
>>
>> ====================
>>
>> #+NAME: average-dataset-size
>> #+BEGIN_SRC clojure :var f="turtle" :exports none :results value
>> (identity f) #+END_SRC
>>
>> #+RESULTS: average-dataset-size
>> : turtle
>>
>>
>> | Format | Sizes distribution in MB | Average size in MB |
>> |--------+--------------------------+--------------------|
>> | turtle |                          | #ERROR             |
>> #+TBLFM: $3='(org-sbe "average-dataset-size" (f $1))
>>
>> ====================
>
> According to `org-sbe' docstring, it should be
>
>   #+TBLFM: $3='(org-sbe "average-dataset-size" (f $$1))
>
> Documentation could be drastically improved in that area, the manual is
> not even talking about `org-sbe'.

Even this doesn't seem to work. In my case:

    #+name: scramble-string
    #+begin_src emacs-lisp :var str="abcde"
      (apply #'string
             (reverse
              (string-to-list str)))
    #+end_src

    #+RESULTS: scramble-string
    : edcba

So far so good

    #+call: scramble-string(str="whatever-foo")

    #+RESULTS:
    : oof-revetahw

So calling scramble-string works as expected...

    #+tblname: reversed-strings
    | abcde   | #ERROR |
    | flibble | #ERROR |
    | dibble  | #ERROR |
    | xyzzy   | #ERROR |
    | another | #ERROR |
    #+TBLFM: $2='(org-sbe scramble-string (str $$1))

Hmm no dice... the debugger lists:

    Substitution history of formula
    Orig:   '(org-sbe scramble-string (str $$1))
    $xyz->  '(org-sbe scramble-string (str $$1))
    @r$c->  '(org-sbe scramble-string (str $$1))
    $1->    '(org-sbe scramble-string (str $"abcde"))
    Result: #ERROR
    Format: NONE
    Final:  #ERROR

Even calling org-sbe directly from a source block:

    #+name: call-scramble-string-via-sbe
    #+begin_src emacs-lisp :var val="thing"
    (org-sbe scramble-string (str val))
    #+end_src

So is this just broken untested functionality or are there any working
examples from which we could reverse engineer the proper docstring?

--
Alex Bennée

Reply via email to