Re: writting anonymous variables in a file

db <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
Hi Jan,

Le 03/02/2014 16:00, Jan Wielemaker a écrit :
> On 02/03/2014 03:43 PM, db wrote:
>> Hello,
>>
>> I want to write atoms with anonymous variables, like p(_, _), in a
>> file, but in the file, each anonymous variable (_) have been
>> replaced by a named anonymous variable, for example _906541.
>
> SWI-Prolog's variables are written _GXXXX or _LXXXX.  Is this SWI-Prolog?

I gave a bad example. The true message is :

"Singleton-marked variable appears more than once: _G506341"


> This suggests you try to write a single non-ground term using
> multiple calls to write, for example as below.
>
> write('hello('), write(X), write(', '), write(Y), write(').\n').

That is what I have done, because I needed to format
my list.
More precisely, I wrote the term
p(_X, _Y)
and further (with numerous writings between them)
the term
p(_Z, _T).

But _X and _Y have been replaced in my destination file
by the same variable _G506341.

Dominique
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.