4.1. More About the Different Variable Types

The next sections talk in detail about each of the different variable types.

4.1.1. Simple Types

Simple types are strings or numbers that are pushed onto the operand stack when executed. Some examples are:

4.1.2. Literals

These are string values (items that start with a alpha value) which are evaluated against the dictionary stack when they are executed.

What is the dictionary stack? The Ripley interpreter starts up with two dictionary predefined. The first is the system dictionary, which contains all of the critical operands and contants values (add, mul, div, def, ripley_version, true, false, etc.) And the user dictionary which is initially empty. The dictionary stack is the set of both the user and system dictionaries. When a literal lookup occurs the user stack is checked first, then the system stack is evaluated.

4.1.3. Arrays

Arrays are sets of variables surrounded by brackets. An example is:

This is an array of the values 1.0, 2.0 and 3.0.

This is an array of the values 1.0, "hi" and 3.0.

4.1.4. Executable Arrays

These are just like arrays, but they are delimited with curly braces. The important difference to the Ripley system is that when they are evaluated they are pushed element by element into the execution stack. Which is then interpreter by the Ripley execution engine. This becomes very important for Functions, which we get into in the next section. Examples of Executable Arrays are in the "Making New Functions" chapter.

4.1.5. Dictionaries

Dictionaries are arrays that are indexed by a unique key instead of by a ascending numeric sequence. Unlike Postscript, which has special functions to build dictionaries, you can define dictionaries using the less than and greater than symbols in Ripley. An example is:

This creates a dictionary with two key value pairs. If the dictionary is accessed with "first_name" you would get "Jack" and "last_name" would get you "Herrington".