The previous article introduced the basic run-time environment, the native
@global Actions that harbor all code and data objects. This article describes the required native Models and Actions found in the
@system Action. There is a core set of Models required for BOOL to function and an extended set that provides more complex data types (such as trees and tables).
The BOOL RTE starts by calling the
@system Action, which initializes all native objects (and constant objects). The Action’s last step is calling the
@global Action, which initializes all library and user objects.
@global Action’s final step is calling the user-defined
@main Action, if the user has defined one. If there is no such Action,
@global just returns to
@system, which returns to the BOOL RTE (which exits).
By the time user code runs, native and library objects are initialized and available. The core set of objects is:
*nullModel is one of several virtual BOOL Models (others are
*one). The value domain for the
*nullModel is only the
- This is almost another virtual Model. It’s kind of a combination of the List meta-type and data Instance objects. It allows you to manipulate List objects somewhat like how the virtual
*anyModel allows access to any object.
- Of course BOOL has a boolean Model! It’s value domain is the constants
- One of two core numeric Models (see below); this one supports integer values. Currently that means Python
- The other core numeric Model (see above); this one supports floating point values. (In this case, Python
- This Model supports string values.
- Arrays are a separate data Model in BOOL (rather than all Models having array capability).
dateobject; why not BOOL?
- This Action exits the BOOL run-time engine. (The first three listed here are the only truly native Actions. That is, there’s no way they can have BOOL code implementations; they’re system-level.)
- This Action forces an early exit from the enclosing Action. It has a “raw BOOL” syntax (
@<) that is actually the “real thing.” The
@returnAction is just syntactical sugar (and the preferred usage).
- These two apply to the enclosing List. The former forces termination of the List processing (executing or evaluating); the latter forces the List to restart. If the List is a loop, these function act as traditional
continuedo in other languages. Both have an underlying syntax:
@^, respectively.The implementation of the
@untilloops below insures the loop condition is evaluated on a
- This important Action implements the if-else code flow control structure. Selection can be accomplished using Gated Lists (which is what this Action does), but the native Action (which can be implemented inline) makes the code more expressive.
- Mirror images of each other, these Actions implement the basic do-while and do-until loops. Both feature top-of-the-loop expression evaluation (so if the expression never evaluates True, the loop code never executes).
- This Action implements a standard “for” loop with an index variable. The Action takes an index object, a range object and a list (or single object) to iterate over.
- The version of a “for” loop implements iteration of a list of objects from some container. The Action takes an object holder variable, a container or list object and target to iterate over.
- A more complex kind of selection Action, it functions just like any switch statement. Each case is compared to the switch expression until a match is found. If none is, the Action does the else case.
- Mirror images of each other, these Actions parallel the
untilloops above. In this case, both feature bottom-of-the-loop expression evaluation (so the loop code always executes at least once). However! Allowing these requires allowing extended Action signature matching at run-time. Currently only the first word of an Action is its key. In this case it results in two Actions named
- Can be used to mean “no value” it has the same function as NULL in C or None in Python.
- The boolean constants mentioned above. The
false:Messages return these values, although BOOL objects can have intrinsic “truthiness” allowing them to be used in expressions expecting a True/False value.
- Integer constants pre-defined in the environment. Other constants are added as required and become native objects.
- Special tokens recognized as the mathematical values for pi, e and c (speed of light).
(Yes, some of these do reflect my personal interests. Why do you ask?)
 Presumably the user does define
@main so that the module has a chance to do something useful. (It’s not impossible that all the code might be in the initialization List of some global Instance object. Actions have a similar aspect in that, for very simple Actions, the code can be entirely in the initialization List of the return object(s). [Yes, I’m still dithering about Actions returning multiple objects.])
 There is also a difference between the RTE running a module (by ultimately invoking
@main) and the RTE loading a module. The BOOL O/S has the capability of loading library modules that provide software services needed by running application.