(reword mention of trplkt shunting using SystemA) |
m (reword and reorganize) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
The '''shunting''' block is the real entry point to any given program implemented as a triple script. In the triple script [[concatenated t-block format]], the shunting block is the one that appears in the tail position (i.e. the last one). |
The '''shunting''' block is the real entry point to any given program implemented as a triple script. In the triple script [[concatenated t-block format]], the shunting block is the one that appears in the tail position (i.e. the last one). The shunting block is the only block allowed to have zero exports, because its main role is to initialize the [[system]] layers and pass control to the real "heart" of the program (which should be the first block, i.e. the one appearing at the beginning of the file). By convention, the shunting block is called "main". |
||
The shunting block is written as a top-level [[IIFE]], and it is the only top-level IIFE that is permitted to do any substantial computation; all other blocks are strictly module definitions. Other modules are permitted to have top-level IIFEs, but only as a compatibility hack for supporting older runtimes with no intrinsic support for the <code>class</code> keyword. These incidental IIFEs are permitted only to make use of [[simple assignment]]s within the IIFE scope for defining the shape of the module through method definitions and other property definitions. |
|||
[[trplkt]]'s shunting strategy uses the [[SystemA]] design pattern. |
[[trplkt]]'s shunting strategy uses the [[SystemA]] design pattern. |
Latest revision as of 16:11, 15 September 2020
The shunting block is the real entry point to any given program implemented as a triple script. In the triple script concatenated t-block format, the shunting block is the one that appears in the tail position (i.e. the last one). The shunting block is the only block allowed to have zero exports, because its main role is to initialize the system layers and pass control to the real "heart" of the program (which should be the first block, i.e. the one appearing at the beginning of the file). By convention, the shunting block is called "main".
The shunting block is written as a top-level IIFE, and it is the only top-level IIFE that is permitted to do any substantial computation; all other blocks are strictly module definitions. Other modules are permitted to have top-level IIFEs, but only as a compatibility hack for supporting older runtimes with no intrinsic support for the class
keyword. These incidental IIFEs are permitted only to make use of simple assignments within the IIFE scope for defining the shape of the module through method definitions and other property definitions.