CS 394P: Introduction to GLISP
Due: April 6, 2005.
The goals of this exercise are to begin using GLISP and to try it
on some examples.
/p/bin/xgcl (Gnu Common Lisp with X interface) should be used for the
Use (load "/u/novak/gll") on a Linux workstation,
or (load "/u/novak/gl") on a Sun workstation,
to load the GLISP files. Use (bye) to exit Lisp.
- Examine the code in the file glexample.lsp
and compile and run the examples and write additions as shown in the file.
Hand in a copy of your Lisp output showing the examples and your code.
A GLISP function is compiled automatically the first time it is called,
so it is not necessary to compile functions explicitly; you can use
(glp) after running a function to see the compiled code.
Some useful functions are:
- (GLC fn) GLISP Compile the function fn
- (GLP fn) Print compiled form of the function fn
- (GLP) Print compiled form of the last function compiled
- (GLCP fn) Compile and Print the function fn
- (PP fn) Pretty-print source form of the function fn
- (PPL sym) Pretty-print the property list of symbol sym
- (STR type) Print the data structure of the type
- (FB fn) True if fn has a Function Binding (definition)
- (LD file) Load file.lsp from the GLISP directory,
e.g. (ld glexample)
- Write a glispobjects description for a data structure that has
circle as a superclass. Test it to verify that circle
properties are available by inheritance.
- Write a glispobjects description for a data structure that
could be viewed as a vector. Write a glispobjects description
for the vector view and verify that vector properties,
such as magnitude, are available through the view. The file
/u/novak/glisp/vector.lsp contains definitions for vectors.
- Run GEV (GLISP Edit Value) on the HPP data, using (gev hpp),
and on examples of your data to understand how GEV works.
- (GEV data 'type) Run GEV. type is not necessary
for object data.
- left button On a field name, prints the type of the field.
On data, zooms in on that data.
- right button Causes a pop-up command menu to appear.
QUIT is part of this menu.
- PROGRAM Write a looping program over current data.
Write programs for:
- Total budget labor over all contracts
- Total executives salary
- Average zip code of the sponsors of contracts