Please enable JavaScript to view this site.

A-Shell Development History

Navigation: Version 6.5/7.0, builds 1600+ > 2022 > 1711 — 23 February 2022

Structure Definition Embedding

Scroll Prev Top Next More

Updated February 2025; see History

Language enhancement: structure definition embedding added to A-Shell. Previously, in order to bind a DYNSTRUCT to a particular structure definition, you needed to use the MX_DYNSTRUCT call with the DYNOP_DEF opcode to compile the DEFSTRUCT from source specified either in a string or a file. It is now possible to embed the definition of selected DEFSTRUCTs inside the RUN file to allow access for DYNSTRUCT binding without needing any source code at run time.

DEFSTRUCTs may be selected for embedding explicitly, through the use of ++PRAGMAs, or implicitly, by certain kinds of statement references that require structure defintion embedding.

The EMBED_DEFSTRUCT PRAGMA causes the definition of the specified DEFSTRUCT (stname), which have already been seen by the compiler, to be embedded in the RUN.

 ++PRAGMA EMBED_DEFSTRUCT stname

An alternative approach is to enclose the DEFSTRUCTs that you want to embed between the following pair of PRAGMAs:

++PRAGMA EMBED_DEFSTRUCTS_BEGIN  

...

++PRAGMA EMBED_DEFSTRUCTS_END

In addition to the above explicit approach, implicit embedding will be activated for any DEFSTRUCT for which an instance variable occurs in either a .BINDSTRUCT statement or in a parameter list passed to a function that receives that parameter as a DYNSTRUCT. Both of these are described in further detail in the following sections.

History

2025 January, A-Shell 7.0.1767:  Programs with embedded DEFSTRUCTs are now compatible across 32 and 64 bit architectures. Previously the structures embedded with the RUN were different depending on which platform it was compiled on, breaking the ability to distribute the same set of RUN files across platforms. Starting with this update, embedded DEFSTRUCTs are compiled as they were in the 32 bit environment, maintaining backwards compatibility there. However, any program with embedded DEFSTRUCTs that gets recompiled in the 64 bit environment will generate an error when attempting to use the embedded DEFSTRUCT if run on an earlier version of A-Shell in the 64 bit environment.