# How to set a global value during execution of a predicate

**URL:** <https://swi-prolog.discourse.group/t/how-to-set-a-global-value-during-execution-of-a-predicate/3043>\
**Category:** Help!\
**Created:** [October 14, 2020, 12:15am UTC](https://swi-prolog.discourse.group/t/how-to-set-a-global-value-during-execution-of-a-predicate/3043 "2020-10-14T00:15:14Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Post date:** [October 14, 2020, 10:49pm UTC](https://swi-prolog.discourse.group/t/how-to-set-a-global-value-during-execution-of-a-predicate/3043/10 "2020-10-14T22:49:16Z")

</div>

> [@ericzinda](#):
>
> Anyone know of a pointer to a complete SWI Prolog meta-interpreter that can run arbitrary SWI Prolog (or SWI Prolog with limitations that most programs don’t care about)?

While Jan W. will be able to give an exact answer, in the mean time I will suggest that if you search the [source code for SWI-Prolog](https://github.com/SWI-Prolog) on GitHub you will find a few places where meta-interpreters are being used, e.g. IIRC the trace and debug predicates. As I don’t have exact working knowledge of them, I suspect that some of the corner cases might be handled with C code.

Also there is a place holder for a [Wiki](https://swi-prolog.discourse.group/t/meta-interpreter/2656) on Meta-interpreters on this site, the part of value is the related [discussion](https://swi-prolog.discourse.group/t/wiki-discussion-meta-interpreter/2657) topic which has some information.

Also some of the SWI-Prolog [packs](https://www.swi-prolog.org/pack/list) use meta-interpreters but I don’t recall which.

HTH

* * *

**EDIT**

Another place to look is in other GitHub repositories with Prolog code. While there are hundreds of such repositories, the better ones are noted [here](https://swi-prolog.discourse.group/t/useful-prolog-references/1089#github).

---

_[View the full topic](https://swi-prolog.discourse.group/t/how-to-set-a-global-value-during-execution-of-a-predicate/3043)._
