emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Myles English <mylesenglish@gmail.com>
To: Sebastien Vauban <wxhgmqzgwmuf@spammotel.com>, emacs-orgmode@gnu.org
Subject: Re: what's wrong with this sbe?
Date: Mon, 05 Mar 2012 15:29:04 +0000	[thread overview]
Message-ID: <871up7dq2n.fsf@gmail.com> (raw)
In-Reply-To: <80linfnnpu.fsf@somewhere.org> (Sebastien Vauban's message of "Mon, 05 Mar 2012 15:09:49 +0100")


Thanks Seb,

* TODO Fix the word wrapping in my emails               :gnus:
  <SCHEDULED: ASAP>

>> 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

  reply	other threads:[~2012-03-05 15:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-05 12:51 what's wrong with this sbe? Myles English
2012-03-05 14:09 ` Sebastien Vauban
2012-03-05 15:29   ` Myles English [this message]
2012-03-05 14:34 ` Eric Schulte
2012-03-05 17:09   ` Myles English
2012-03-05 17:17     ` Myles English
2012-03-05 17:46     ` Eric Schulte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871up7dq2n.fsf@gmail.com \
    --to=mylesenglish@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=wxhgmqzgwmuf@spammotel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).