What is the use of dynload?

The sole purpose of dynload is for doing initialization.

Say in a file named ‘foo.dats’, we have the following line:

dynload “bar.dats”

This line gets compiled to a call to the initialization function
associated with ‘bar.dats’. Without this line, a link-time error message
of the form “…_dynload_flag is undefined” is to be reported.

If you don’t want the initialization function for ‘bar.dats’ to be
called, then please add the following line in ‘bar.dats’:

#define ATS_DYNLOADFLAG 0

Please do this with caution.

Normally, ‘dynload’ lines should only occur in the file that contains the
implementation of the ‘main’ function.

Are there any examples or conventions related to naming initialization
functions? I see plenty of .dats files without

#define ATS_DYNLOADFLAG 0

but nothing necessarily stood out as an initialization function.On Thursday, November 21, 2013 4:47:02 PM UTC-5, gmhwxi wrote:

The sole purpose of dynload is for doing initialization.

Say in a file named ‘foo.dats’, we have the following line:

dynload “bar.dats”

This line gets compiled to a call to the initialization function
associated with ‘bar.dats’. Without this line, a link-time error message
of the form “…_dynload_flag is undefined” is to be reported.

If you don’t want the initialization function for ‘bar.dats’ to be
called, then please add the following line in ‘bar.dats’:

#define ATS_DYNLOADFLAG 0

Please do this with caution.

Normally, ‘dynload’ lines should only occur in the file that contains the
implementation of the ‘main’ function.

The initialization functions are named internally and calls to these
functions
are inserted by the compiler automatically.On Sunday, January 19, 2014 4:39:42 PM UTC-5, Brandon Barker wrote:

Are there any examples or conventions related to naming initialization
functions? I see plenty of .dats files without

#define ATS_DYNLOADFLAG 0

but nothing necessarily stood out as an initialization function.

On Thursday, November 21, 2013 4:47:02 PM UTC-5, gmhwxi wrote:

The sole purpose of dynload is for doing initialization.

Say in a file named ‘foo.dats’, we have the following line:

dynload “bar.dats”

This line gets compiled to a call to the initialization function
associated with ‘bar.dats’. Without this line, a link-time error message
of the form “…_dynload_flag is undefined” is to be reported.

If you don’t want the initialization function for ‘bar.dats’ to be
called, then please add the following line in ‘bar.dats’:

#define ATS_DYNLOADFLAG 0

Please do this with caution.

Normally, ‘dynload’ lines should only occur in the file that contains the
implementation of the ‘main’ function.