GPRINT: A LISP Pretty Printer Providing Extensive User Format Control Mechanism

A Lisp pretty printer is presented which makes it easy for a user to control the format of the output produced. The printer can be used as a general mechanism for printing data structures as well as programs. It is divided into two parts: a set of formatting functions and an output routine. Th...

Full description

Bibliographic Details
Main Author: Waters, Richard C.
Language:en_US
Published: 2004
Online Access:http://hdl.handle.net/1721.1/6342
_version_ 1826198289065705472
author Waters, Richard C.
author_facet Waters, Richard C.
author_sort Waters, Richard C.
collection MIT
description A Lisp pretty printer is presented which makes it easy for a user to control the format of the output produced. The printer can be used as a general mechanism for printing data structures as well as programs. It is divided into two parts: a set of formatting functions and an output routine. The user specifies how a particular type of object should be formatted by creating a formatting function for the type. When passed an object of that type, the formatting function creates a sequence of directions which specify how the object should be printed if it can fit on one line and how it should be printed if it must be broken up across multiple lines. A simple template language makes it easy to specify these directions. Based on the line length available, the output routine decides what structures have to be broken up across multiple lines and produces the actual output following the directions created by the formatting functions. The paper concludes with a discussion of how the pretty printing method presented could be applied to languages other than Lisp.
first_indexed 2024-09-23T11:02:32Z
id mit-1721.1/6342
institution Massachusetts Institute of Technology
language en_US
last_indexed 2024-09-23T11:02:32Z
publishDate 2004
record_format dspace
spelling mit-1721.1/63422019-04-10T18:32:35Z GPRINT: A LISP Pretty Printer Providing Extensive User Format Control Mechanism Waters, Richard C. A Lisp pretty printer is presented which makes it easy for a user to control the format of the output produced. The printer can be used as a general mechanism for printing data structures as well as programs. It is divided into two parts: a set of formatting functions and an output routine. The user specifies how a particular type of object should be formatted by creating a formatting function for the type. When passed an object of that type, the formatting function creates a sequence of directions which specify how the object should be printed if it can fit on one line and how it should be printed if it must be broken up across multiple lines. A simple template language makes it easy to specify these directions. Based on the line length available, the output routine decides what structures have to be broken up across multiple lines and produces the actual output following the directions created by the formatting functions. The paper concludes with a discussion of how the pretty printing method presented could be applied to languages other than Lisp. 2004-10-04T14:52:21Z 2004-10-04T14:52:21Z 1982-09-01 AIM-611a http://hdl.handle.net/1721.1/6342 en_US AIM-611a 29 p. 11436761 bytes 7870601 bytes application/postscript application/pdf application/postscript application/pdf
spellingShingle Waters, Richard C.
GPRINT: A LISP Pretty Printer Providing Extensive User Format Control Mechanism
title GPRINT: A LISP Pretty Printer Providing Extensive User Format Control Mechanism
title_full GPRINT: A LISP Pretty Printer Providing Extensive User Format Control Mechanism
title_fullStr GPRINT: A LISP Pretty Printer Providing Extensive User Format Control Mechanism
title_full_unstemmed GPRINT: A LISP Pretty Printer Providing Extensive User Format Control Mechanism
title_short GPRINT: A LISP Pretty Printer Providing Extensive User Format Control Mechanism
title_sort gprint a lisp pretty printer providing extensive user format control mechanism
url http://hdl.handle.net/1721.1/6342
work_keys_str_mv AT watersrichardc gprintalispprettyprinterprovidingextensiveuserformatcontrolmechanism