# Ats\_static\_prefix

**URL:** https://discourse.ats-lang.org/t/ats-static-prefix/771
**Category:** Google Group
**Created:** [August 29, 2014, 7:10am UTC](https://discourse.ats-lang.org/t/ats-static-prefix/771 "2014-08-29T07:10:09Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)
#### Post date: [August 29, 2014, 7:10am UTC](https://discourse.ats-lang.org/t/ats-static-prefix/771/1 "2014-08-29T07:10:09Z")

</div>

The flag ATS\_STATIC\_PREFIX, if set, determines the prefix for the names  
of static variables and functions in the C code generated from ATS source.

Say ATS\_STATIC\_PREFIX is defined as follows in some DATS-file:

#define ATS\_STATIC\_PREFIX “foo\_”

When the DATS-file is compiled into C, the prefix ‘foo\_\_’ is attached to  
the original names  
of static variables and functions in the generated C code.

This feature can be very useful if one wants to mix the C code generated  
from multiple ATS  
source files as doing so is likely to result in name conflicts among static  
variables and  
functions in the C code. Such conflicts can be resolved by properly setting  
ATS\_STATIC\_PREFIX.  
The same applies to loading PHP code generated from ATS source.
