<div dir="ltr"><div dir="ltr"><div>Julian, thanks.</div><div><br></div><div>I have refactored / restructured my code and it's all good now...I kind of get the explanation but I kept the bad code so I can go back and study harder later.</div><div><br></div><div>I'm not really understanding your comment about , </div><div><br></div><div>> The !IO there represents IO1 = IO2.<br></div><div><br></div><div><br></div><div><br></div><div>Thanks again.</div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 16 Aug 2019 at 14:53, Julian Fondren <<a href="mailto:jfondren@minimaltype.com">jfondren@minimaltype.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 2019-08-16 08:38, emacstheviking wrote:<br>
> ...but I can't see what I have done wrong!!!!<br>
...<br>
> execute(GfxState, !IO) :-<br>
> (<br>
> basic_window("blah", 0, 0, 400, 200, GfxState, {GfxState1,<br>
> yes}, !IO)<br>
> -><br>
<br>
There's your problem. The !IO there represents IO1 = IO2.<br>
Does this unification actually happen? If basic_window fails,<br>
it doesn't happen. So you've passed IO1 to basic_window for<br>
its own use, and then have to use IO1 again because you didn't<br>
get a new IO2 because the unification never happened.<br>
<br>
Reusing IO1 means it's no longer unique.<br>
</blockquote></div></div>