From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Banel Subject: Re: evaluate cpp snippet in org babel with default includes and customized entry point Date: Sat, 16 Sep 2017 11:36:56 +0200 Message-ID: <59BCF0B8.8040300@free.fr> References: <877ewz9j4x.fsf@gmail.com> <59BCE1F6.3060406@free.fr> <8760cj9gz2.fsf@gmail.com> <59BCE6DA.80907@free.fr> <874ls39fzi.fsf@gmail.com> <59BCEAB2.3020708@free.fr> <87377n9faf.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34103) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dt9X2-0003VI-MB for emacs-orgmode@gnu.org; Sat, 16 Sep 2017 05:37:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dt9X2-0003uz-11 for emacs-orgmode@gnu.org; Sat, 16 Sep 2017 05:37:00 -0400 Received: from smtp2-g21.free.fr ([2a01:e0c:1:1599::11]:16266) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dt9X1-0003sa-Qs for emacs-orgmode@gnu.org; Sat, 16 Sep 2017 05:36:59 -0400 Received: from [IPv6:2a01:e35:2e21:def0:351e:772c:a55d:35db] (unknown [IPv6:2a01:e35:2e21:def0:351e:772c:a55d:35db]) by smtp2-g21.free.fr (Postfix) with ESMTP id 435472003A4 for ; Sat, 16 Sep 2017 11:36:57 +0200 (CEST) In-Reply-To: <87377n9faf.fsf@gmail.com> 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: emacs-orgmode@gnu.org On 16/09/2017 11:14, Amos Bird wrote: > > Hmm, is it possible to customize babel's c++ backend to achieve this? > You mean, hiding the call to twoSum() somewhere? I am not aware of any=20 basic way to achieve that. > I may also want a evaluation that submits the code to online judge and=20 > returns the result. > This seems to be another topic. One that Babel is not concerned about.=20 Are you trying to set up a work-flow where students submit their=20 solutions to a teacher who is the "judge"? Isn't email between students=20 and teacher just the simple and straightforward work-flow? > Thierry Banel writes: > > > You still need to explicitly call twoSum(), and that cannot be hidden= . > > > > On 16/09/2017 10:58, Amos Bird wrote: > > > > Ok, i get the idea. So how can I customized the default code=20 > expansion so that it can directly evaluate this > > > > class Solution { > > public: > > vector twoSum(vector& nums, int target) { > > > > } > > }; > > =96 > Amos Bird > amosbird@gmail.com >