Overview

Functionality to print the common lisp types have been implemented. The types specified below now prints according to the hyperspec.

The architechture for the Lisp Printer in CLforJava is a bit unique. To use the Lisp Printer you can call PRINT-OBJECT with the object that needs to be printed. The PRINT-OBJECT function determines at runtime the objects type and calls the appropriate printfunction for that type.

There is a printfunction interface that defines the methods that are to be implemented when writing a print function for a type. This allows for a new printfunction to be written at runtime. Inside of each type there is a Printer class the implements printfunction and extends its parent type. Because of this feature the only printfunction that needs to be implemented is the one for type T, due to inheritence all subtypes will automatically use this printfunction as a default unless overloaded. The only method that needs to be overloaded is the funcall(arg1, arg2) method. The field PRINT_FUNCTION in type T is not final which allows it to be changed at runtime.

T Printer

As an example the code for the inner class Printer for type T is included. This will provide an example of how each printfunction's funcall needs to be implemented.

In the list below, those bullets link to other pages where they can be properly explained.

Other printers that have been implemented are:

Each bullet links to a new page, click on the question mark and edit those. Thank you!

-- PeterNguyen - 23 Apr 2006

Topic revision: r6 - 2009-03-11 - 20:26:22 - MadelineWilliams
 
Home
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback