From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex =?utf-8?Q?Benn=C3=A9e?= Subject: Re: Table (used a "spreadsheet") org-sbe issues when the value is a string Date: Wed, 06 Sep 2017 16:32:45 +0100 Message-ID: <87efrjn8pu.fsf@linaro.org> References: <35a64fca-7d01-b382-15f0-568d93af4f61@fgiasson.com> <87k2hgakna.fsf@saiph.selenimh> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57900) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpcJv-0002Wb-Ng for emacs-orgmode@gnu.org; Wed, 06 Sep 2017 11:32:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dpcJs-00038r-DG for emacs-orgmode@gnu.org; Wed, 06 Sep 2017 11:32:51 -0400 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]:35868) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dpcJs-00038C-68 for emacs-orgmode@gnu.org; Wed, 06 Sep 2017 11:32:48 -0400 Received: by mail-wm0-x232.google.com with SMTP id i145so30872995wmf.1 for ; Wed, 06 Sep 2017 08:32:48 -0700 (PDT) In-reply-to: <87k2hgakna.fsf@saiph.selenimh> 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" To: Nicolas Goaziou Cc: emacs-orgmode@gnu.org, Frederick Giasson Nicolas Goaziou writes: > Hello, > > Frederick Giasson 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