From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bjarte Johansen Subject: Re: org-babel for prolog Date: Fri, 19 Dec 2014 16:25:53 +0100 Message-ID: <619F74FC-4D9C-47FC-ADC8-2897FFF052F3@infomedia.uib.no> References: <65BF665A-C03D-4CCB-A8C6-A052BDD1BEBD@infomedia.uib.no> Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_226C5BBE-4A2C-4AA4-ABC8-C5C9F23CDEE8" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58129) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1zRQ-00061z-I8 for emacs-orgmode@gnu.org; Fri, 19 Dec 2014 10:26:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y1zRG-0002Jw-II for emacs-orgmode@gnu.org; Fri, 19 Dec 2014 10:26:08 -0500 Received: from alfons.uib.no ([129.177.30.141]:41146) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1zRG-0002JB-7S for emacs-orgmode@gnu.org; Fri, 19 Dec 2014 10:25:58 -0500 Received: from alfux.uib.no (smtp.uib.no) [2001:700:200:6::a:1f0c] by alfons.uib.no for emacs-orgmode@gnu.org with esmtp (Exim 4.84) id 1Y1zRA-0003Hz-24; Fri, 19 Dec 2014 16:25:52 +0100 Received: from pc-115-216.eduroam.uib.no [129.177.115.216]:56429 by smtp.uib.no for emacs-orgmode@gnu.org with esmtpsa (Exim 4.84) id 1Y1zR9-0004st-N5; Fri, 19 Dec 2014 16:25:51 +0100 In-Reply-To: <65BF665A-C03D-4CCB-A8C6-A052BDD1BEBD@infomedia.uib.no> 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --Apple-Mail=_226C5BBE-4A2C-4AA4-ABC8-C5C9F23CDEE8 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 I just wanted to report that it is now possible to evaluate prolog code = and it should return the correct result. Both as a call to the = executable and in a session. When calling a goal in a session, I add a = cut at the end of the goal so that prolog doesn=E2=80=99t ask if you = want to get the next possible answer. I am not sure if this is the best = approach. I haven=E2=80=99t implemented variable assignment yet because I = haven=E2=80=99t decided how it should do that considering how prolog = uses variables. If someone has any ideas for this I would be glad to = hear them. I have considered entering the variables into the prolog = database with the record predicates or replacing all prolog variables = with the same name as in the var declaration with the value. The last = one I don=E2=80=99t think is a particularly good idea, except if we only = replace the free variables. Regards, Bjarte > 10. des. 2014 kl. 18.20 skrev Bjarte Johansen = : >=20 > Hi, >=20 > I have started to implement org-babel support for (swi-)prolog. I have = gotten to the point where I can execute a goal in an external process = and have the result show up in the org file. I am now working on getting = the session to work correctly. It runs and prints, but it doesn=E2=80=99t = do the correct thing in the inferior-mode-buffer and the output is = garbled. I still have some work ahead of me. >=20 > I just thought I would let you know in case someone was interested in = following the progress or maybe also in helping me. I have the mode = hosted in its current state here = https://gist.github.com/ljos/2e346333e1b7bfd56d05 = .=20 >=20 > And before you ask, yes, if I get this into a working order, I would = eventually be interested in getting this into either contrib or core. >=20 > Regards, > Bjarte --Apple-Mail=_226C5BBE-4A2C-4AA4-ABC8-C5C9F23CDEE8 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
I just wanted to report that it is now = possible to evaluate prolog code and it should return the correct = result. Both as a call to the executable and in a session. When calling = a goal in a session, I add a cut at the end of the goal so that prolog = doesn=E2=80=99t ask if you want to get the next possible answer. I am = not sure if this is the best approach.

I haven=E2=80=99t implemented variable = assignment yet because I haven=E2=80=99t decided how it should do that = considering how prolog uses variables. If someone has any ideas for this = I would be glad to hear them. I have considered entering the variables = into the prolog database with the record predicates or replacing all = prolog variables with the same name as in the var declaration with the = value. The last one I don=E2=80=99t think is a particularly good idea, = except if we only replace the free variables.

Regards,
Bjarte


10. = des. 2014 kl. 18.20 skrev Bjarte Johansen <Bjarte.Johansen@infomedia.uib.no>:

Hi,

I have started to = implement org-babel support for (swi-)prolog. I have gotten to the point = where I can execute a goal in an external process and have the result = show up in the org file. I am now working on getting the session to work = correctly. It runs and prints, but it doesn=E2=80=99t do the correct = thing in the inferior-mode-buffer and the output is garbled. I still = have some work ahead of me.

I just thought I would let you know in case someone was = interested in following the progress or maybe also in helping me. I have = the mode hosted in its current state here https://gist.github.com/ljos/2e346333e1b7bfd56d05 .&nb= sp;

And before = you ask, yes, if I get this into a working order, I would eventually be = interested in getting this into either contrib or core.

Regards,
Bjarte

= --Apple-Mail=_226C5BBE-4A2C-4AA4-ABC8-C5C9F23CDEE8--