emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Daniel Hackney <dan@haxney.org>
To: Eric Schulte <schulte.eric@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [ob-calc] bug when given table data as a variable
Date: Thu, 6 Mar 2014 20:02:57 -0500	[thread overview]
Message-ID: <CAMqXDZsk=-7cJLeiBE-3mx+ho9kbfNGD50MA6Yoz1aYtVR79ag@mail.gmail.com> (raw)
In-Reply-To: <87siqvt1jo.fsf@gmail.com>

Eric Schulte <schulte.eric@gmail.com> wrote:
> Org-mode's calc support is very limited. I think someone with a
> working knowledge of how calc uses vectors would need to add table
> support. Unfortunately calc experts seem to be few and far between.

Looking at the calc source code was not terribly helpful, since it is
barely documented. The info page can help somewhat, though.

Doing a little bit of digging, it looks like you can bind variables for
=calc-eval= like so:

#+BEGIN_SRC elisp
(let ((var-a "[1, 2, 3]"))
 (calc-eval "evalv(reduce(add, a))"))
#+END_SRC

#+RESULTS:
: 6

This pattern could be used for variable binding. It would mean wrapping
the code to be evaluated in =evalv=. If I get some time, I might
investigate writing a patch to do this.

--
Daniel Hackney

      reply	other threads:[~2014-03-07  1:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-05  3:34 [ob-calc] bug when given table data as a variable Daniel Hackney
2014-03-06 22:10 ` Eric Schulte
2014-03-07  1:02   ` Daniel Hackney [this message]

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='CAMqXDZsk=-7cJLeiBE-3mx+ho9kbfNGD50MA6Yoz1aYtVR79ag@mail.gmail.com' \
    --to=dan@haxney.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=schulte.eric@gmail.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).