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

Duncan Patton a Campbell <[email protected]>
Newsgroups gmane.comp.gnu.prolog.general
Organization 240am ltd.
Message-ID <[email protected]>
> 
> 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
> [email protected]
> http://lists.gnu.org/mailman/listinfo/users-prolog
> 
> 
> End of Users-prolog Digest, Vol 40, Issue 1
> *******************************************
>

_______________________________________________
Users-prolog mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/users-prolog
signature.asc (application/pgp-signature, 187 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (FreeBSD)

iD8DBQFEV5emLTWJrqFvCJsRApl/AJ42micWuByX7zHSx2fs7jAbn/+RLQCbBSzw
Wwd5A1vtGlcOzZ/rXSQohXg=
=RirY
-----END PGP SIGNATURE-----
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.