From mboxrd@z Thu Jan 1 00:00:00 1970 From: Myles English Subject: Re: what's wrong with this sbe? Date: Mon, 05 Mar 2012 15:29:04 +0000 Message-ID: <871up7dq2n.fsf@gmail.com> References: <8762ejdxe3.fsf@ed.ac.uk> <80linfnnpu.fsf@somewhere.org> Reply-To: emacs-orgmode@gnu.org, Myles English Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([208.118.235.92]:55828) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4Zmy-00014c-Ux for emacs-orgmode@gnu.org; Mon, 05 Mar 2012 10:25:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S4Zma-0002a3-Ce for emacs-orgmode@gnu.org; Mon, 05 Mar 2012 10:25:28 -0500 Received: from mail-bk0-f41.google.com ([209.85.214.41]:46446) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4Zma-0002Y5-40 for emacs-orgmode@gnu.org; Mon, 05 Mar 2012 10:25:04 -0500 Received: by bkwq16 with SMTP id q16so4052737bkw.0 for ; Mon, 05 Mar 2012 07:25:02 -0800 (PST) In-Reply-To: <80linfnnpu.fsf@somewhere.org> (Sebastien Vauban's message of "Mon, 05 Mar 2012 15:09:49 +0100") 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Sebastien Vauban , emacs-orgmode@gnu.org Thanks Seb, * TODO Fix the word wrapping in my emails :gnus: >> On Mon, 05 Mar 2012 15:09:49 +0100, Sebastien Vauban said: > Hi Myles, Myles English wrote: >> Please could tell me where I am going wrong with this? I just >> can't get the source block to put a result in the table. >> >> #+name: workingDays #+BEGIN_SRC emacs-lisp :var hms="0" (require >> 'org-timer) (/ (org-timer-hms-to-secs hms) (* 60 60 8)) #+END_SRC >> >> #+call: workingDays(hms="236:30:00") >> >> #+RESULTS: workingDays(hms="236:30:00") : 29 >> >> | Days | H:M:S | |--------+-----------| | #ERROR | >> 236:30:00 | #+TBLFM: @2$1='(sbe "workingDays" (hms @2$2)) > This is because the string you send in the `sbe' call should be > (double-)quoted, as in: > | Days | H:M:S | |------+-------------| | 29 | > "236:30:00" | #+TBLFM: @2$1='(sbe workingDays (hms @2$2)) > This is really annoying for most cases, and dates back from a > problem to distinguish between references and strings, at some > point. Yes it is quite annoying. After your help I tried various combinations of (quote),(print),(string),(number-to-string) and (concat), both in the TBLFM line and in the source block but found that this is the only way to get a slightly unsatisfactory result: | Days | H:M:S | | |------+-----------+-------------| | 29 | 236:30:00 | "236:30:00" | | | | | #+TBLFM: @2$3='(print (concat "\"" @2$2 "\""))::@2$1='(sbe workingDays (hms @2$3)) > I wonder whether this heavy constraint (strings must be enclosed) > still applies or not. > Best regards, Seb > PS- No need to quote the function name... > -- Sebastien Vauban Thanks again, Myles