users-prolog
[Top][All Lists]
Advanced

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

Re: Users-prolog Digest, Vol 40, Issue 1


From: Duncan Patton a Campbell
Subject: Re: Users-prolog Digest, Vol 40, Issue 1
Date: Tue, 2 May 2006 11:32:22 -0600

> 
> I have this program(a.pl):
> 
> initialization(allfacts(L)).
> fact(a).
> fact(b).
> allfacts(L):-
>      bagof(fact(A),fact(A),L).
> 
> after doing "gplc a.pl" it created a.exe. First of all, I got a warning
> saying "warning: singleton variables [L] for initialization/1",could you
> tell me what does this mean? Secondly, when I run a.exe, it opened a
> prolog prompt and did not automatically execute
> initialization(allfacts(L)). Is it possible so that when I run a.exe, it
> does not go into a prolog prompt and just executes "allfacts" and prints
> the result to the screen?
> 
> Thank you Daniel :)
> 
> Anthony
> 

I don't have too much experience with WinDos of late so
I can't help you with stdio prebloms, but the "singleton variable",
warning is because you are instantiating "L" and then doing
nothing with it.  If your were to put, say, "write(L)" after
the allfacts call, this would cease and you will probably
see some output as well.

Dhu



> 
> 
> 
> ------------------------------
> 
> _______________________________________________
> Users-prolog mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/users-prolog
> 
> 
> End of Users-prolog Digest, Vol 40, Issue 1
> *******************************************
> 

Attachment: pgpYVv5l2cBBW.pgp
Description: PGP signature


reply via email to

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