[m-users.] Problem with XML extra library

Volker Wysk post at volker-wysk.de
Thu Jun 23 22:17:59 AEST 2022


Am Donnerstag, dem 23.06.2022 um 21:04 +1000 schrieb Julien Fischer:
> 
> On Thu, 23 Jun 2022, Zoltan Somogyi wrote:
> 
> > The reason why the code you are talking about works is because
> > 
> > - the pstate/5 predicate called near the start of that clause has
> >  <io> and <pstate(unit)> as its two DCG arguments;
> > - the finish/3 predicate called near the end of that clause has
> >  <pstate(T1)> and <io> as its two DCG arguments; and
> > - the code in between uses !IO to refer to variables whose type is
> >  pstate(T) for some T.
> > 
> > That last part is misleading for human readers, but the compiler
> > neither knows this, nor does it care. This probably happened
> > because the person converting the code from DCGs to state variable
> > notation did not notice the switch in types from io states to pstates
> > and then back to io states. (When the code still used DCGs,
> > the code was less misleading, because the variables holding the pstates
> > were nameless, instead of having misleading names.)
> > 
> > I will look into fixing this readability/style issue.
> 
> Given the code that was quoted, I suspect Volker is looking at the
> version of tryit.m from the 22.01 branch, rather than what's currently
> on the trunk. That version of tryit.m does not use state variables at
> all, only DCGs.

Actually, I've been looking at the rotd-2022-02-07 version of Mercury.

> 
> The confusion with the variable naming on the trunk was an oversight
> on my part when I updated that code to conform with the recent library
> changes.

I've downloaded the GIT version. It won't compile on my box because of
standard library changes (io.environment is new).

I'll install Mercury from the GIT sources and give it another try.

Thanks.

Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.mercurylang.org/archives/users/attachments/20220623/eea19799/attachment.sig>


More information about the users mailing list