Re: tell and listing

markmuetz <[email protected]>
Newsgroups gmane.comp.gnu.prolog.general
Message-ID <[email protected]>
I have a working solution to this problem. I couldn't get listing to go to a
file (despite putting all commands on one line and separating with commas,
as advice suggested), but I can write out each node individually.
?- ['file.pl'].
?- retract(node(node1,_,_)).
?- tell('file2.pl').
?- node(A,B,C), write(node(A,B,C)),fail.%equivalent to listing(node) but
goes to file
?- told.


Yury Luneff-2 wrote:
> 
> В Пнд, 30/04/2007 в 10:32 -0700, markmuetz пишет:
>> Hi,
>> 
>> I'm trying to load a prolog file (using ['file.pl'].), modify it and then
>> save the changes (e.g to 'file2.pl'). To do this I'm calling 
>> ?- ['file.pl'].
>> ?- retract(node(node1,_,_)).
>> ?- tell('file2.pl'). 
>> ?- listing.
>> I was expecting the output of listing to go to the file, but instead it
>> goes
>> to the terminal. I tried playing around with the open/3 predicate but to
>> no
>> avail. How do I go about doing this properly (i.e. get listing to go to a
>> file and not to the terminal)?
>> 
>> Thanks in advance,
>> Mark
> AFAIK you should write everything you want to be a program as a single
> line, w/o pressing enter after each statement. In addition it is
> recommended to say 'told' after you've written the file.
> -- 
> Лунёв Юрий
> ТТИ ЮФУ, 2007
> 
> 
> 
> _______________________________________________
> Users-prolog mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/users-prolog
> 
> 

-- 
View this message in context: http://www.nabble.com/tell-and-listing-tf3670927.html#a10267647
Sent from the Gnu - Prolog - Users mailing list archive at Nabble.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.