From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bjarte Johansen Subject: Re: org-babel for prolog Date: Fri, 2 Jan 2015 14:29:49 +0100 Message-ID: <04441E2C-21DB-4A7B-AF73-76D5AA2CA2CB@infomedia.uib.no> References: <65BF665A-C03D-4CCB-A8C6-A052BDD1BEBD@infomedia.uib.no> <619F74FC-4D9C-47FC-ADC8-2897FFF052F3@infomedia.uib.no> Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_F65B8156-F480-4C4D-BF6D-025646338106" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44316) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y72In-0007O4-5K for emacs-orgmode@gnu.org; Fri, 02 Jan 2015 08:30:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y72Ii-0003y6-6H for emacs-orgmode@gnu.org; Fri, 02 Jan 2015 08:30:05 -0500 Received: from alfons.uib.no ([129.177.30.141]:42834) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y72Ih-0003xu-Rv for emacs-orgmode@gnu.org; Fri, 02 Jan 2015 08:30:00 -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 1Y72Id-0002Iz-0O; Fri, 02 Jan 2015 14:29:55 +0100 Received: from pc-115-206.eduroam.uib.no [129.177.115.206]:52821 by smtp.uib.no for emacs-orgmode@gnu.org with esmtpsa (Exim 4.84) id 1Y72Ic-0001lB-H2; Fri, 02 Jan 2015 14:29:54 +0100 In-Reply-To: <619F74FC-4D9C-47FC-ADC8-2897FFF052F3@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=_F65B8156-F480-4C4D-BF6D-025646338106 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 I thought you should know that I moved the project here: = https://github.com/ljos/ob-prolog = This makes it a bit easier for me to track issues and do proper = commit-messages etc. I have now implemented the session stuff properly (I think). I still = have to implement the variable stuff and expansion of the body (or I can = perhaps just use the generic function).=20 > 19. des. 2014 kl. 16.25 skrev Bjarte Johansen = : >=20 > 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. >=20 > 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. >=20 > Regards, > Bjarte >=20 >=20 >> 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 >=20 --Apple-Mail=_F65B8156-F480-4C4D-BF6D-025646338106 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
I thought you should know that I moved the = project here: https://github.com/ljos/ob-prolog This makes it a = bit easier for me to track issues and do proper commit-messages = etc.

I have = now implemented the session stuff properly (I think). I still have to = implement the variable stuff and expansion of the body (or I can perhaps = just use the generic function). 


19. des. 2014 kl. 16.25 skrev Bjarte Johansen = <Bjarte.Johansen@infomedia.uib.no>:

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=99= t 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=_F65B8156-F480-4C4D-BF6D-025646338106--