emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Dmitrii Korobeinikov <dim1212k@gmail.com>
To: "Berry, Charles" <ccberry@ucsd.edu>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: [Proposal] Source Blocks with Post-Extensions
Date: Mon, 22 Apr 2019 23:15:34 +0600	[thread overview]
Message-ID: <CA+Yh0STXHO5HU+JFhm4ODcp6874uvFbmOK-fjbwAQXJQ8W_PmA@mail.gmail.com> (raw)
In-Reply-To: <AAB30FFE-1534-40CE-8B45-FAB385C150A2@ucsd.edu>

[-- Attachment #1: Type: text/plain, Size: 1469 bytes --]

Thank you!
That's a handy technique and it does help.
As I understand, there's no way to extend that to multiple lines?
One-liners for tests are enough sometimes, but not always.
For those cases, it is cumbersome to split as well.

пн, 22 апр. 2019 г. в 22:51, Berry, Charles <ccberry@ucsd.edu>:

> It looks like you want the :epilogue header argument. See inline.
>
> > On Apr 22, 2019, at 2:00 AM, Dmitrii Korobeinikov <dim1212k@gmail.com>
> wrote:
> >
> > When I write several source blocks, which depend on one another, I tend
> to debug them one by one.
> >
> > So, I write this function and test it:
> >
> > #+NAME: square
> > #+BEGIN_SRC python
> >     square = lambda x: x * x
> >     return square(5)
> > #+END_SRC
> >
> > #+RESULTS: square
> > : 25
> >
>
>
> Equivalently, you could run this:
>
> #+NAME: square
> #+BEGIN_SRC python :epilogue  return square(5)
>     square = lambda x: x * x
> #+END_SRC
>
>
>
> > After I see that the test is successful, I write this client function:
> >
> > #+BEGIN_SRC python :noweb yes
> >     <<square>>
> >     return 5 + square(5)
> > #+END_SRC
> >
> > #+RESULTS:
> > : 25
> >
> > And here, to get the correct result, I have to remove the ~return
> square(5)~ line in ~<<square>>~.
> > But I don't want to lose testing!
> > S
>
> With my version of `square`, the epilogue is not included.
>
> So it works as you want it to.
>
> HTH,
>
> Chuck
>
>
>

[-- Attachment #2: Type: text/html, Size: 2166 bytes --]

  reply	other threads:[~2019-04-22 17:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-22  9:00 [Proposal] Source Blocks with Post-Extensions Dmitrii Korobeinikov
2019-04-22 16:51 ` Berry, Charles
2019-04-22 17:15   ` Dmitrii Korobeinikov [this message]
2019-04-22 17:31     ` Berry, Charles
2019-04-24 19:05       ` Dmitrii Korobeinikov
2019-06-26 22:09         ` Martin Alsinet
2019-07-03 16:02           ` Dmitrii Korobeinikov
2019-07-26 12:02           ` Ken Mankoff
2019-07-26 12:58             ` Martin Alsinet
2019-07-26 15:18               ` Ken Mankoff
2019-07-26 15:52                 ` Martin Alsinet
2019-04-22 20:59 ` Tim Cross

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=CA+Yh0STXHO5HU+JFhm4ODcp6874uvFbmOK-fjbwAQXJQ8W_PmA@mail.gmail.com \
    --to=dim1212k@gmail.com \
    --cc=ccberry@ucsd.edu \
    --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).