From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Berry, Charles" Subject: Re: [Proposal] Source Blocks with Post-Extensions Date: Mon, 22 Apr 2019 16:51:23 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:45035) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIcDi-00013D-P3 for emacs-orgmode@gnu.org; Mon, 22 Apr 2019 12:55:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hIcAH-0004Tb-63 for emacs-orgmode@gnu.org; Mon, 22 Apr 2019 12:51:34 -0400 Received: from iport-bcv4-out.ucsd.edu ([132.239.0.122]:45563) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1hIcAG-0004Ph-Ka for emacs-orgmode@gnu.org; Mon, 22 Apr 2019 12:51:33 -0400 In-Reply-To: Content-Language: en-US Content-ID: <54F9F4E378B67C41A74032F20A3C4C25@AD.UCSD.EDU> 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" To: Dmitrii Korobeinikov Cc: emacs-orgmode It looks like you want the :epilogue header argument. See inline. > On Apr 22, 2019, at 2:00 AM, Dmitrii Korobeinikov wr= ote: >=20 > When I write several source blocks, which depend on one another, I tend t= o debug them one by one. >=20 > So, I write this function and test it: >=20 > #+NAME: square > #+BEGIN_SRC python > square =3D lambda x: x * x > return square(5) > #+END_SRC >=20 > #+RESULTS: square > : 25 >=20 Equivalently, you could run this: #+NAME: square #+BEGIN_SRC python :epilogue return square(5) square =3D lambda x: x * x #+END_SRC > After I see that the test is successful, I write this client function: >=20 > #+BEGIN_SRC python :noweb yes > <> > return 5 + square(5) > #+END_SRC >=20 > #+RESULTS: > : 25 >=20 > And here, to get the correct result, I have to remove the ~return square(= 5)~ line in ~<>~. > But I don't want to lose testing! > S With my version of `square`, the epilogue is not included.=20 So it works as you want it to. HTH, Chuck