GETTING STARTED IN *LISP Version 6.1, June 1991 Copyright (c) 1991 by Thinking Machines Corporation. "Fish say, they have their stream and pond; But is there anything beyond?" Chapter 7: Going Further with *Lisp Rupert Brooke *********************************** 7.1 Topics We Haven't Covered There are some *Lisp topics that we haven't covered in this Get- ting Started guide. You can find out more about them by looking in the *Lisp Dictionary. They are described briefly below. Creating and Using Array Pvars *Lisp has parallel equivalents of most of the array and vector operations of Common Lisp. In this document, we've only seen one of these, make-array!!. Section 1.5 of the overview chapter in the *Lisp Dictionary provides a complete list of all array pvar operations in *Lisp. Along with operations for array pvars, *Lisp includes specialized operations for vector pvars and bit-array pvars, and parallel equivalents of Common Lisp sequence opera- tors, for example find!!, length!!, position!!, and substitute!!. These are also listed in Section 1.5. Turning Array Pvars "Sideways" If you use array pvars heavily in your *Lisp code, you may want to consider turning your arrays "sideways." This operation changes the arrangement of data in your array pvars so that the CM can access them more efficiently. For more information about "sideways" arrays, see the dictionary entries for sideways-aref!! and *sideways-array. Creating and Using *defstruct Pvars In this guide, we've barely touched on the use of *defstruct for defining structure pvars, but structure pvars are a powerful tool for defining your own parallel data types. For more information about structure pvars and examples of how to create them, see the dictionary entry for *defstruct. Dynamically Allocating Blocks of CM Memory Along with permanent, local, and temporary pvars, there is a fourth kind of pvar known as a global pvar. Allocated by the *Lisp operator allocate!!, global pvars are used to allocate and reference large amounts of CM memory within your *Lisp programs. Whereas you will typically allocate permanent pvars one at a time, you can allocate dozens or even hundreds of global pvars at one time, and store them in a list to be used whenever you need them. For more information, see the dictionary entry for allo- cate!!. Defining Segment Set Objects for Scanning Along with the scan!! operator, there is a more advanced scanning function, segment-set-scan!!, that uses a "segment set" data structure to define where the segments of a pvar begin and end. These segment set data objects are created by the function create-segment-set!!, and there are a large number of *Lisp func- tions for accessing the contents of these segment set objects. For more information, see the dictionary entries for segment- set-scan!! and create-segment-set!!. Just For Fun: Controlling The Front Panel LEDs Finally, *Lisp includes a function called *light which takes a boolean pvar and calls an internal Paris function to set the state of the front panel LEDs of the CM. For more information, see the dictionary entry for *light, and also the entries for the Paris operators cm:latch-leds and cm:set-system-leds-mode in the Connection Machine Parallel Instruction Set (Paris) manual. 7.2 Where Do You Go from Here? I hope this Getting Started guide has given you the start you need towards proficient *Lisp programming. Here are some suggest- ed sources to which you can turn for further information about *Lisp programming and more examples of *Lisp code: o The *Lisp Dictionary contains a complete list of all *Lisp functions and macros, as well as information on type de- clarations and compiler options that you'll find very handy. o The directory /cm/starlisp/interpreter/f6100 contains a number of example *Lisp files. The names of these files are listed in the file examples-def-file-set.lisp in this direc- tory. o Your fellow *Lisp programmers are a good source of informa- tion, sample code, and help in debugging recalcitrant pro- grams. Ask around among the *Lisp people you know for help and advice. o Finally, you can contact Thinking Machines Corporation Cus- tomer Support for help and advice on *Lisp programming, via the email address given in the front of this guide. May all your parentheses balance, and may all your CM processors be active!