users-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tell and listing


From: markmuetz
Subject: Re: tell and listing
Date: Tue, 1 May 2007 04:22:39 -0700 (PDT)

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
> address@hidden
> 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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]