Subject: [SWIPL] bug (or feature) in initialization

From: David Poole <[email-masked]>
Date: Wed, 18 Apr 2001 22:58:52 -0700

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,   [email-masked]
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