[mercury-users] term / term_io / varset

Tomas By T.By at dcs.shef.ac.uk
Thu Mar 29 10:37:16 AEST 2001


Fergus Henderson writes:
> On 28-Mar-2001, Tomas By <T.By at dcs.shef.ac.uk> wrote:
> > I'm trying to use the Mercury parser to read Prolog code, and I'm
> > having problems with anonymous variables. It seems they are renamed
> > to `V_'number - what is the recommended way to find out if a
> > `term__var' is anonymous?
> 
> `parser__read_term' does not give them names.  If you call
> `varset__lookup_name' on an unnamed variable, it will use the "V_%d" form.
> But the solution to that is just don't use `varset__lookup_name' -- instead,
> you should use `varset__search_name'.

Ah, ok. So "has no name" in the documentation means "anonymous"?

Hmm, yes, I guess that makes sense. I thought maybe the actual string
used for the name was retained also for anonymous variables.

Thanks.

/Tomas
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list