emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Achim Gratz <Stromeko@nexgo.de>
To: emacs-orgmode@gnu.org
Subject: Re: [PATCH] bug in expansion of variables in babel Perl
Date: Sat, 02 Mar 2013 23:01:52 +0100	[thread overview]
Message-ID: <87d2vh8nqn.fsf@Rainer.invalid> (raw)
In-Reply-To: 87d2vphccc.fsf@Rainer.invalid

Achim Gratz writes:
> Here are two patches that fix this and implement (partly) some of your
> suggestions.  I don't think Org should pollute the global Perl namespace
> by default, so I've left the definition of org-babel-perl-preface to the
> user for now.  The second patch has the debugging aid you've been
> requesting, if you bind the symbol org-babel--debug-input to anything
> the temporary input files won't be deleted after the code has run.

I've pushed these changes with some extended babel support for Perl: the
results are now interpreted by babel, like for most other languages.
Also, the wrapper has been extended to be a bit smarter: if the return
value is an arrayref (or arrayref of arrayrefs), the wrapper
automatically formats the output so that it will be interpreted as a
table (a simple arrayref will be interpreted as a column vector).  In
particular that means you can pass a table through a Perl source block
with exactly no code to write (as the variable that is input will be
returned directly).  In all other cases the return value is simply
printed, so it should be a scalar.  I've kept the wrapper as an
(anonymous) subroutine, so if anybody had latched onto "return $rv;" it
will continue to work.  Also a few tests were added.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptations for Waldorf Q V3.00R3 and Q+ V3.54R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

      parent reply	other threads:[~2013-03-02 22:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-24  9:16 bug in expansion of variables in babel Perl D M German
2013-02-24  9:45 ` dmg
2013-02-24 10:23   ` D M German
2013-02-24 13:08     ` Achim Gratz
2013-02-24 18:20       ` D M German
2013-02-24 12:17 ` Achim Gratz
2013-02-24 16:52   ` Eric Schulte
2013-02-24 17:15     ` Achim Gratz
2013-02-24 18:03     ` Achim Gratz
2013-02-25  9:44       ` D M German
2013-02-24 17:05 ` [PATCH] " Achim Gratz
2013-02-25  9:42   ` D M German
2013-02-25 12:48     ` Achim Gratz
2013-02-25 21:54       ` D M German
2013-02-26 11:13         ` Achim Gratz
2013-03-02 22:01   ` Achim Gratz [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=87d2vh8nqn.fsf@Rainer.invalid \
    --to=stromeko@nexgo.de \
    --cc=emacs-orgmode@gnu.org \
    /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).