Ats_mainatsflag

Say you have a file foo.dats containing an implementation
of the ‘main’ function written in C directly:

%{$

int main (…) { … }

%}

Please make sure that the flag ATS_MAINATSFLAG is set to 1
in foo.dats:

#define ATS_MAINATSFLAG 1

This will allow ATS/Postiats to generate a proper dynload-function
for foo.dats.

Yes.

If you want to call a dynload-function explicitly, then you can assign
a name to it first:

#define ATS_DYNLOADNAME “some_name_for_dynload_function”

Here is an example involving both ATS_MAINATSFLAG and ATS_DYNLOADNAME:

https://github.com/githwxi/ATS-Postiats-contrib/blob/master/projects/MEDIUM/ATS-parse-emit/JavaScript/TEST/fact2.datsOn Tuesday, August 26, 2014 11:28:19 PM UTC-4, Artyom Shalkhakov wrote:

On Wednesday, August 27, 2014 1:13:18 AM UTC+6, gmhwxi wrote:

Say you have a file foo.dats containing an implementation
of the ‘main’ function written in C directly:

%{$

int main (…) { … }

%}

Please make sure that the flag ATS_MAINATSFLAG is set to 1
in foo.dats:

#define ATS_MAINATSFLAG 1

This will allow ATS/Postiats to generate a proper dynload-function
for foo.dats.

What about ATS_DYNLOADNAME? Seems like it’s used for specifying the name
of the dynload function in generated code.

Say you have a file foo.dats containing an implementation
of the ‘main’ function written in C directly:

%{$

int main (…) { … }

%}

Please make sure that the flag ATS_MAINATSFLAG is set to 1
in foo.dats:

#define ATS_MAINATSFLAG 1

This will allow ATS/Postiats to generate a proper dynload-function
for foo.dats.

What about ATS_DYNLOADNAME? Seems like it’s used for specifying the name of
the dynload function in generated code.