Programming Gri
1: Introduction 2: Simple example 3: Fancy example 4: Running Gri 5: Programming Gri 6: General Issues 7: X-Y Plots 8: Contour Plots 9: Image Plots 10: Examples 11: Handling Data 12: Gri Commands 13: Gri Extras 14: Evolution of Gri 15: Installing Gri 16: Gri Bugs 17: System Tools 18: Acknowledgments 19: License 20: Newsgroup 21: Concept Index |
5: Programming in the Gri LanguageThe Gri programming language has `if ' statements to control program
flow, and a `while ' statement to repeat commands. There are two
data types in Gri: ``variables'' (to store numbers) and ``synonyms'' (to
store character strings). Gri recognizes commands by matching
statements against its list of known commands. This list is extensible;
it is easy to add new commands as extensions to Gri.
5.1: Online HelpType `help ' to get a list of available commands and other topics of
interest. Here's how Gri responds
help set ' and `help set x '. When you ask for help on a
multi-word command, Gri tells you about all commands which begin
with the words you've typed. Thus,
draw zero line '. The response to the
most complete request is:
{} ', which are used to enclose multiple words which act as one
unit; they are used to clarify the choices presented to the OR
operator.) Following the syntactical description are examples. Each
example is indented 2 spaces, and a description of it (which always
starts with an upper-case character and ends with a period, to indicate
that it's an English description) follows that, indented by an
additional 2 spaces.
5.2: Command LinesTo extend a command across several lines, use a backslash `\\ ' at
the very end of all lines but the last:
|