Native Objects

Native Objects have as if definitions, but are (usually) implemented with native code. BOOL defines the following:

Native Actions

Actions are callable code blocks, and a key design goal behind BOOL is that its syntax contains only one flow control structure used in the definition of any Actions (including native ones).

@[name] — performs a “goto” and transfers code execution to name (which must be a labeled section of code).

@^ — jumps to beginning of current code block (similar to “continue”).

@_ — jumps to the end of the current code block (similar to “break”).

@< obj — push obj onto the Parameter Stack.

@> obj — pop Parameter Stack into obj.

@return — exit current Action and return to caller.

@exit — exit the BOOL system.

Native Models

Models are data types, and BOOL defines a number of standard types:

*bool — TRUE or FALSE

*int — integer number

*float — real number (floating point)

*char — individual character

*string — strings of characters

*date — date and time

BOOL also defines some generic types that can be used as parameters in Actions. They allow a very simple form of type-checking:

*any — accepts any object, including list objects

*one — accepts any single object (no lists)

*list — accepts only list objects

Native Messages

Certain Messages are considered “native” in that all objects must respond to them.

Q: — Query; evaluate and push value on PStack.

X: — Execute; evaluate (as with Q:), but push nothing on PStack.

T: — True, is object; push TRUE or FALSE on PStack

F: — False, is object; push FALSE or TRUE on PStack

W: — Where; push self on PStack (same as Q: for objects)

N: — Name; push name (as a string) on PStack

A: — Array, is object an; push TRUE or FALSE on PStack

P: — Properties; push Property List on PStack

D: — Duplicate; push a clone of self on PStack

Note that Messages are not case-sensitive, but BOOL forces them to uppercase internally.

%d bloggers like this: