From poole@cs.ubc.ca Thu Apr 19 07:59:27 2001
Received: from pedigree.cs.ubc.ca (root@pedigree.cs.ubc.ca [142.103.6.50])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f3J5xP324025
	for <prolog@swi.psy.uva.nl>; Thu, 19 Apr 2001 07:59:26 +0200 (MET DST)
Received: from cs.ubc.ca (root@cascade.cs.ubc.ca [142.103.7.7]) by pedigree.cs.ubc.ca (8.8.8/8.6.9) with ESMTP id WAA01664; Wed, 18 Apr 2001 22:59:23 -0700 (PDT)
Message-ID: <3ADE7E9C.9B39D0F0@cs.ubc.ca>
Date: Wed, 18 Apr 2001 22:58:52 -0700
From: David Poole <poole@cs.ubc.ca>
X-Mailer: Mozilla 4.73 [en] (Windows NT 5.0; U)
X-Accept-Language: en,pdf
MIME-Version: 1.0
To: prolog@swi.psy.uva.nl
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Subject: [SWIPL] bug (or feature) in initialization

Hi All,
I have a simple logic programming interpreter that I want to start up
when I load a file. My "start" predicate is a read-eval-print loop. I
want to do:
:- initialization(start).
This works in Sicstus Prolog. However in SWI prolog, when start does a
"read", it doesn't read from the terminal (as I would like, and as
Sicstus does) it instead gets a end_of_file (^D) which I don't like (my
program doesn't like it either).  I think this a bug. (Note that this
has the same behaviour (in SWI and in Sicstus) if I do:
:- start.

While I am asking questions. Is there any chance of getting
"when(Cond,Goal)", as in Sicstus Prolog implemented in SWI Prolog? This
is a very useful predicate that cannot be implemented without hacking
the internals of Prolog. (I want to delay negation as failure and for
unbound goals and inequalities that cannot be immediately resolved in my
meta-interpreter).

If anyone is interested, the logic programming interpreter is CILog
obtainable from:
http://www.cs.ubc.ca/spider/poole/ci/code/cilog/cilog_man.html
and the code from:
http://www.cs.ubc.ca/spider/poole/ci/code/cilog/cilog_swi.pl

Thanks,
David

-- 
David Poole,                      Office: +1 (604) 822-6254
Professor,                        Fax:    +1 (604) 822-5485
Department of Computer Science,   poole@cs.ubc.ca
University of British Columbia,   http://www.cs.ubc.ca/spider/poole
Vancouver, B.C., Canada V6T 1Z4   ftp://ftp.cs.ubc.ca/ftp/local/poole

