<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://permalink.gmane.org/gmane.comp.ai.prolog.swi">
    <title>gmane.comp.ai.prolog.swi</title>
    <link>http://permalink.gmane.org/gmane.comp.ai.prolog.swi</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16822"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16821"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16820"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16819"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16818"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16817"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16816"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16815"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16814"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16813"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16812"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16811"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16810"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16809"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16808"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16807"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16806"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16805"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16804"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16803"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16822">
    <title>Re: help with command line options</title>
    <link>http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16822</link>
    <description>&lt;pre&gt;
 Hi Don:

This sort of thing is typically done this way:

jeffr&amp;lt; at &amp;gt;jeffr-SX2803:~$ swipl -s tmp1.pl -q -g 'answer_to_the_ultimate_question(A),writeln(A), halt' -t 'halt(1)' &amp;amp;&amp;amp; echo ok || echo fail
42
ok
jeffr&amp;lt; at &amp;gt;jeffr-SX2803:~$ 

 
That is, cause your goal to be executed as the initialization (-g) goal, not the toplevel (-t) goal. This way, if your goal fails it'll return a bad exit status. Make sure your goal halts, or you will end up halting with a bad exit status. The -c switch is only used if you are producing an binary executable using -o.

Regards,
Jeff R.

 

-----Original Message-----
From: don batory &amp;lt;batory&amp;lt; at &amp;gt;cs.utexas.edu&amp;gt;
To: swi-prolog &amp;lt;swi-prolog&amp;lt; at &amp;gt;lists.iai.uni-bonn.de&amp;gt;
Sent: Fri, May 25, 2012 10:00 am
Subject: [SWIPL] help with command line options


I have been unable to run prolog from the command line

to (a) load a  swi prolog file and (b) execute a predicate/goal.

The predicate writes to a file, so I can see that it has executed.

 

Ive tried a variety of combinations (and orderings) of the c&lt;/pre&gt;</description>
    <dc:creator>Jeff Rosenwald</dc:creator>
    <dc:date>2012-05-25T15:02:13</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16821">
    <title>Re: help with command line options</title>
    <link>http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16821</link>
    <description>&lt;pre&gt;Hi Don,

You might want to check that your command line includes
no unicode, unlike your email


typically non-ascii characters like "–" get written into 
web-page documentation by "clever" pretty-printers, then
cut and pasted into shells, with confusion following.
Likewise, your quotes are non-ascii;

Best

Jim
&lt;/pre&gt;</description>
    <dc:creator>J.J.Green</dc:creator>
    <dc:date>2012-05-25T14:55:15</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16820">
    <title>Re: help with command line options</title>
    <link>http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16820</link>
    <description>&lt;pre&gt;Here are two ways of doing this.
Regards,
Ralf

$ echo ":- write(hello),nl,halt." &amp;gt; hello.pro
$ swipl --quiet -f hello.pro
hello
$ echo "main :- write(hello),nl,halt." &amp;gt; hello.pro
$ swipl --quiet -f hello.pro -t main
hello


On Fri, May 25, 2012 at 3:59 PM, don batory &amp;lt;batory&amp;lt; at &amp;gt;cs.utexas.edu&amp;gt; wrote:

-------------- next part --------------
HTML attachment scrubbed and removed
&lt;/pre&gt;</description>
    <dc:creator>Ralf Laemmel</dc:creator>
    <dc:date>2012-05-25T14:43:45</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16819">
    <title>help with command line options</title>
    <link>http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16819</link>
    <description>&lt;pre&gt;I have been unable to run prolog from the command line

to (a) load a  swi prolog file and (b) execute a predicate/goal.

The predicate writes to a file, so I can see that it has executed.

 

Ive tried a variety of combinations (and orderings) of the command below:

 

Ø  swipl  -t printout c trules.pl

 

where printout is the goal to execute once trules.pl has been loaded.

 

If someone can explain what I am doing wrong, Id be most appreciative.

Thank you in advance.

 

don Batory.

-------------- next part --------------
HTML attachment scrubbed and removed
&lt;/pre&gt;</description>
    <dc:creator>don batory</dc:creator>
    <dc:date>2012-05-25T13:59:06</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16818">
    <title>Re: arithmetic_function</title>
    <link>http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16818</link>
    <description>&lt;pre&gt;On Fri, May 25, 2012 at 1:44 PM, Leopold, Matthias
&amp;lt;Matthias.Leopold&amp;lt; at &amp;gt;dzb.de&amp;gt; wrote:

User defined arithmetic functions have been removed from swi-pl recently.
Now there's a compatibility library for most of the old functionality:

http://cliopatria.swi-prolog.org/help/source/doc/swi/library/arithmetic.pl

To use this library you must use the directive:

?- use_module(library(arithmetic)).

Are you using this library, or your code has been written for an old
version of swi-prolog?

Cheers
P.
_______________________________________________
SWI-Prolog mailing list
SWI-Prolog&amp;lt; at &amp;gt;lists.iai.uni-bonn.de
https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog
&lt;/pre&gt;</description>
    <dc:creator>Pierpaolo Bernardi</dc:creator>
    <dc:date>2012-05-25T12:27:08</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16817">
    <title>Re: arithmetic_function</title>
    <link>http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16817</link>
    <description>&lt;pre&gt;Quicky: use

:- use_module(library(arithmetic)).

This directive is compiled and cannot be called through the autoloader 
(contradicting the manual :-().

Cheers --- Jan

On 25/05/12 13:44, Leopold, Matthias wrote:

&lt;/pre&gt;</description>
    <dc:creator>Jan Wielemaker</dc:creator>
    <dc:date>2012-05-25T12:21:29</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16816">
    <title>arithmetic_function</title>
    <link>http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16816</link>
    <description>&lt;pre&gt;Dear all,

being new to this list I hope to use it as it is thought to be.

I use an arithmetic_function like

  :- arithmetic_function(predicate/5).

  predicate(P1, P2, P3, P4, P5, P6) :-
    (P1 = ..., P6 is 0, !
    ;P2 = ..., P6 is 1, !
    ...
    ), !.


The architecture is to use both definitions within a module that is compiled into an executable (so no screen). With using the swi-pl version 6 I get now the message "Wrong context: arithmetic_function/1 can only be used in a directive". What is my mistake?

Thank you very much

Matthias Leopold
&lt;/pre&gt;</description>
    <dc:creator>Leopold, Matthias</dc:creator>
    <dc:date>2012-05-25T11:44:56</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16815">
    <title>Re: Ann: SWI-Prolog 6.1.5</title>
    <link>http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16815</link>
    <description>&lt;pre&gt;Hi Jan

Problem with SWI-Prolog 6.1.5. and the editor :
I can't use anymore AltGr key to type '[', ']',  '&amp;lt; at &amp;gt;' ...

Joël


On 24/05/2012 21:03, Jan Wielemaker wrote:

&lt;/pre&gt;</description>
    <dc:creator>Joel Foutelet</dc:creator>
    <dc:date>2012-05-25T09:35:19</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16814">
    <title>Re: A problem about SWI-Prolog</title>
    <link>http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16814</link>
    <description>&lt;pre&gt;Hi,

why don´t you give your predicates name back:

highPrice(X,Name) :- goodQuality(X,'goodQuality').
highPrice(X,Name) :- lookNice(X,'lookNice').

Greetings Lyn

Am 24.05.2012 um 17:30 schrieb 徐天宇:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: &amp;lt;https://lists.iai.uni-bonn.de/pipermail/swi-prolog/attachments/20120525/dbb0162b/attachment.bin&amp;gt;
_______________________________________________
SWI-Prolog mailing list
SWI-Prolog&amp;lt; at &amp;gt;lists.iai.uni-bonn.de
https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog
&lt;/pre&gt;</description>
    <dc:creator>Lyn Matten</dc:creator>
    <dc:date>2012-05-25T07:55:24</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16813">
    <title>Re: Packages</title>
    <link>http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16813</link>
    <description>&lt;pre&gt;
Dear Jan,

A packaging tool was long overdue. Congratulations for your efforts in  bringing it to Swi. 

I think it will take a bit more than a few weeks to establish the
system as the Prolog community has not being at all good at sharing code.
I hope you persevere, Swi is an excellent vehicle for changing attitudes.
Getting the first ones up and running is crucial.

Personally, I try to make code available through my website, and I hope to 
package it using your tool.
For instance : 
http://bioinformatics.nki.nl/~nicos/sware/dlp/mcmcms
However, I had no time to look into it yet.

From the sounds of it, it would appear that the package only stays on the
uploaders website. Wouldn't it make sense to keep a cache somewhere on your
servers as well? I think most successful repositories are quite centralised
so the users can expect continuity. Ideally the Prolog community should have
common servers for prolog code, but I cannot see who would organise this.

I suggest a discussion at ICLP this year ? 
At CICLOPS '&lt;/pre&gt;</description>
    <dc:creator>Nicos Angelopoulos</dc:creator>
    <dc:date>2012-05-25T06:37:49</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16812">
    <title>Re: Packages</title>
    <link>http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16812</link>
    <description>&lt;pre&gt;You need 1 place that organizes *everything*. Because right now if I need something I don't know where to look.

I saw Packs on your site, but that meant nothing to me.  Then you have packages in the Semantic web link, then there's Manual where you have the main manual and "package" manuals.  In the main manual you have several "included" packages like CHR and Appendix A with clp and csv.

And then there's the "C" part of the standard distro, whose documentation covers sockets and I continually forget what that's hiding.  Except for Google, I still don't know where it is.

If it's unified, people can go 
to one  place to find stuff, or go to that place to contribute.  
  

Alan Baljeu


From: Jan Wielemaker &amp;lt;J.Wielemaker&amp;lt; at &amp;gt;vu.nl&amp;gt;

To: SWI-Prolog&amp;lt; at &amp;gt;lists.iai.uni-bonn.de 
Sent: Thursday, May 24, 2012 3:23:20 PM
Subject: [SWIPL] Packages
 
Hi,

Clearly, something is wrong with my package initiative. I know the
version in 6.1.4 suffered from technical issues. I also happen to know
from the download statistics &lt;/pre&gt;</description>
    <dc:creator>Alan Baljeu</dc:creator>
    <dc:date>2012-05-25T01:12:47</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16811">
    <title>Re: New logo</title>
    <link>http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16811</link>
    <description>&lt;pre&gt;
Nice.


In fact it has, for instance to Winnie the Pooh.

   --- nef


&lt;/pre&gt;</description>
    <dc:creator>Norbert E. Fuchs</dc:creator>
    <dc:date>2012-05-24T21:42:25</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16810">
    <title>Re: New logo</title>
    <link>http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16810</link>
    <description>&lt;pre&gt;
Hi Jan,

On 24/05/2012, at 20:10, Jan Wielemaker wrote:


Nice work, Steve. It looks greaat :-)

Cheers,

Paulo



-----------------------------------------------------------------
Paulo Jorge Lopes de Moura, PhD
Assistant Professor
Dep. of Computer Science, University of Beira Interior
6201-001 Covilhã, Portugal

Office 3.18  Ext. 3276
Phone: +351 275 242081 Fax: +351 275 319899
Email: &amp;lt;mailto:pmoura&amp;lt; at &amp;gt;di.ubi.pt&amp;gt;

Home page: &amp;lt;http://www.di.ubi.pt/~pmoura&amp;gt;
Research:  &amp;lt;http://logtalk.org/&amp;gt; Blog: &amp;lt;http://blog.logtalk.org/&amp;gt;
-----------------------------------------------------------------








&lt;/pre&gt;</description>
    <dc:creator>Paulo Moura</dc:creator>
    <dc:date>2012-05-24T21:24:39</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16809">
    <title>Packages</title>
    <link>http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16809</link>
    <description>&lt;pre&gt;Hi,

Clearly, something is wrong with my package initiative. I know the
version in 6.1.4 suffered from technical issues. I also happen to know
from the download statistics that nearly all users happen to prefer the
stable (e.g., 6.0.x) version. The reported issues should be solved in
6.1.5.

Nevertheless, only a small `hello world' package and only 2 downloads
indicate there is something wrong.

On the other hand, I received enough mail that indicates that people want
a package system and I see successes using repositories for other systems.

Please, provide feedback on what you think is wrong.  Also, think of the
code you have lying around and want to share.  Creating a pack is really
easy and only requires a packaging tool (tar or zip), a place on the web
to upload to (Dropbox can be used as indicated by the hello package) and
an internet connection.

Cheers --- Jan

&lt;/pre&gt;</description>
    <dc:creator>Jan Wielemaker</dc:creator>
    <dc:date>2012-05-24T19:23:20</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16808">
    <title>New logo</title>
    <link>http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16808</link>
    <description>&lt;pre&gt;Hi,

After a far too long delay and several chats, I've made a decision on
the new SWI-Prolog logo.  You find the new logo on the website as well
as in the application icons of 6.1.5.

The winning logo is an owl by Steve Reeves (http://www.pixelmagic.co.nz/).

The logo is simple and colourful, while an owl has various relevant 
associations.

The logo is distributed under the creative commons SA (Share Alike) license,
which implies you can make your own variations as long as you distribute 
them
under the same license.

Thanks to everybody who contributed!

Enjoy --- Jan
&lt;/pre&gt;</description>
    <dc:creator>Jan Wielemaker</dc:creator>
    <dc:date>2012-05-24T19:10:56</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16807">
    <title>Ann: SWI-Prolog 6.1.5</title>
    <link>http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16807</link>
    <description>&lt;pre&gt;Hi,

I've uploaded SWI-Prolog 6.1.5.  Highlights:

   * Fixed handling of interrupt (Control-C) on non-Windows platforms.
     (solved by Keri Harris).
   * Avoid compiling files in system mode when compiling from the debugger
     and the debugger is running in its own thread.
   * Fixed two debugger-related GC errors (causes crashes while debugging)
   * Reduced locking in findall/3 and sending messages between threads.
     (more will follow for findall/3).
   * Avoid leaking memory on the trail-stack when using setarg/3 (also
     attributed variables) in certain settings.
   * Fixed some arithmetic issues; added copysign/2.
   * Some issues with the package system: address of the server, create
     user directory and deal with older versions of libarchive.
   * Replaced website and program icons with the new logo.

Enjoy --- Jan


=================================
SWI-Prolog Changelog since V6.1.4
=================================

  * PORT: Use _copysign() on Microsoft compilers.  Per Mildner.

  * A&lt;/pre&gt;</description>
    <dc:creator>Jan Wielemaker</dc:creator>
    <dc:date>2012-05-24T19:03:24</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16806">
    <title>Re: A problem about SWI-Prolog</title>
    <link>http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16806</link>
    <description>&lt;pre&gt;
On 24/05/2012, at 16:30, 徐天宇 wrote:


One solution is to write a meta-interpreter that returns both the query results an explanation how the query was proved. The downside is that a meta-interpreter will carry a performance penalty.

Cheers,

Paulo


-----------------------------------------------------------------
Paulo Jorge Lopes de Moura, PhD
Assistant Professor
Dep. of Computer Science, University of Beira Interior
6201-001 Covilhã, Portugal

Office 3.18  Ext. 3276
Phone: +351 275 242081 Fax: +351 275 319899
Email: &amp;lt;mailto:pmoura&amp;lt; at &amp;gt;di.ubi.pt&amp;gt;

Home page: &amp;lt;http://www.di.ubi.pt/~pmoura&amp;gt;
Research:  &amp;lt;http://logtalk.org/&amp;gt; Blog: &amp;lt;http://blog.logtalk.org/&amp;gt;
-----------------------------------------------------------------








_______________________________________________
SWI-Prolog mailing list
SWI-Prolog&amp;lt; at &amp;gt;lists.iai.uni-bonn.de
https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog
&lt;/pre&gt;</description>
    <dc:creator>Paulo Moura</dc:creator>
    <dc:date>2012-05-24T19:01:37</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16805">
    <title>Re: A problem about SWI-Prolog</title>
    <link>http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16805</link>
    <description>&lt;pre&gt;A solution would be to add an argument to highPrice that tells you the
reason:

highPrice(X,goodQuality) :- goodQuality(X).
highPrice(X,lookNice) :- lookNice(X).
highPrice(X,monopolize):- monopolize(X, _).
...

highPrice(iPhone,Y), will give you in Y the reasons why iPhone have
highPrice.
Regards,

Edison.

2012/5/24 徐天宇 &amp;lt;xty213&amp;lt; at &amp;gt;gmail.com&amp;gt;




&lt;/pre&gt;</description>
    <dc:creator>Edison Mera</dc:creator>
    <dc:date>2012-05-24T18:58:19</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16804">
    <title>A problem about SWI-Prolog</title>
    <link>http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16804</link>
    <description>&lt;pre&gt;Hello everybody! I'm a green hand of Prolog, and I have a problem must be
solved now. Hope you can give me some helpful suggestions.

In real world, one result may be reasoned by different  premises. In
Prolog, we may find several solutions to one query, each solution uses
different predicates. For example, a following program:

highPrice(X):- goodQuality(X).
highPrice(X):- lookNice(X).
highPrice(X):- monopolize(X,_).

goodQuality(iPhone).
lookNice(iPhone).
monopolize(someOtherPhone,cellPhone).

If we do a query: highPrice(iPhone), we will get true; true; false. But I
want to figure out *by which predicate did I find the solution, *for
example, the first output is true because goodQuality(iPhone). Do i have
some ways to get the predicate I used and address this problem? If you have
any idea please help me, thanks. :)
-------------- next part --------------
HTML attachment scrubbed and removed
&lt;/pre&gt;</description>
    <dc:creator>徐天宇</dc:creator>
    <dc:date>2012-05-24T15:30:34</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16803">
    <title>Fw:  ~&gt;</title>
    <link>http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16803</link>
    <description>&lt;pre&gt;(Sorry Jan, didn't mean to send only to you.)

 Trying this.  The following code fails when call(Handler...) throws an exception (because the other end dropped the link).  Instead of closing the connection, close_connection complains that In is unbound.  But it was bound before the call went out.  Is the flaw here, or elsewhere?



process_client(Socket, _Peer, Handler) :-
    (  tcp_open_socket(Socket, In, Out)
    ~&amp;gt; close_connection(In, Out)  )
    , call(Handler, In, Out)
    .
 
Alan Baljeu


From: Jan Wielemaker &amp;lt;J.Wielemaker&amp;lt; at &amp;gt;vu.nl&amp;gt;

To: Alan Baljeu &amp;lt;alanbaljeu&amp;lt; at &amp;gt;yahoo.com&amp;gt; 
Sent: Tuesday, May 22, 2012 11:04:40 AM
Subject: Re: [SWIPL] ~&amp;gt;
 
On 05/22/2012 04:46 PM, Alan Baljeu wrote:

Except that it leaves a choice point.  Of course, there is some
danger here that a later release is smart enough to delete this ...'

In my view, relying on non-determinism in setup_call_cleanup/3 is also 
the weak point of ~&amp;gt;.   The idea is to do

    open(File, read, In) ~&amp;gt; close(In),
    process&lt;/pre&gt;</description>
    <dc:creator>Alan Baljeu</dc:creator>
    <dc:date>2012-05-22T15:21:12</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16802">
    <title>setup_call_(catcher)_cleanup</title>
    <link>http://permalink.gmane.org/gmane.comp.ai.prolog.swi/16802</link>
    <description>&lt;pre&gt;I imagined these would be equivalent unless an exception occurs, but the former quits while the latter works.  What's going on?

create_client(Host, Port) :-
        setup_call_cleanup(tcp_socket(Socket),
                                   tcp_connect(Socket, Host:Port),
                                   tcp_close_socket(Socket)),
        setup_call_cleanup(tcp_open_socket(Socket, In, Out),
                           chat_to_server(In, Out),
                           close_connection(In, Out)).

create_client(Host, Port) :-
        setup_call_catcher_cleanup(tcp_socket(Socket), %% different
                                   tcp_connect(Socket, Host:Port),
                                   exception(_), %% different
                                   tcp_close_socke&lt;/pre&gt;</description>
    <dc:creator>Alan Baljeu</dc:creator>
    <dc:date>2012-05-22T15:03:41</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.ai.prolog.swi">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.ai.prolog.swi</link>
  </textinput>
</rdf:RDF>

