Chapters: 1: Introduction 2: Simple example 3: Invocation 4: Finer Control 5: X-Y Plots 6: Contour Plots 7: Image Plots 8: Examples 9: Gri Commands 10: Programming 11: Environment 12: Emacs Mode 13: History 14: Installation 15: Gri Bugs 16: Test Suite 17: Gri in Press 18: Acknowledgments 19: License Indices: Concepts Commands Variables |
10.11.1: Purpose of newcommandsGri can be extended easily. Primitive commands (e.g. `set x name ')
can be supplemented with so-called "new commands." New commands are a
little like subroutines other programming languages. For example, you
might find that you often draw filled curves with a particular graylevel
(say 0.5), and then return the graylevel to the previous value. This
requires you to do the following each time:
This gets a bit tedious, and it would obviously be nicer to just say something like
To make this shortcut, you'd tell Gri about the existence of a new
command called ` Once you've learned how to make new commands, you are likely to use them a lot. The following explains how you add new commands. For advice on programming style, etc., (see Resource File).
|