Format Library

Previous Page TOC Index Next Page See Page

Mindy Compiler Mindy Debugger Mindy Object Extensions Streams Library Standard IO Print Library Format Library Melange Interface TK Library Collection extensions Table Extensions String extensions Regular Expressions Transcendental Library Time Library Random Library Matrix Library


The Format Library

Designed by the Gwydion Project

Version 1.0 : 004 June 97

This document describes the Format library designed by the Gwydion Project at Carnegie Mellon University. This library extends the functionality of the format strings described in Dylan’s condition system and provides two new functions for processing the extended format strings. The Format library is a small library, but it requires the Print library and some of the Streams library from the Gwydion Project. The Format library exports one module, Format, which exports all the idnetifiers described in this document.

1. Functions

The Format library offers two functions, format and format-to-string.

format [Generic Function]

Arguments
Values
Description

format [Method]

Arguments
Values
Description

format-to-string [Generic Function]

Arguments
Values
Description

format-to-string [Method]

Arguments
Values
Description

print-message [Generic Function]

Arguments
Values
Description

print-message [Sealed Method]

Arguments
Values
Description

print-message [Sealed Method]

Arguments
Values
Description

print-message [Sealed Method]

Arguments
Values
Description

2. Control Strings

The Format library’s format strings, or control strings, offer the same directives as Dylan’s format strings offer, but this library provides a few more directives and permits a single argument to all format directives. The argument is an integer that must appear contiguously between the dispatch character (%) and the format directive, and it indicates a printing field in which to justify the output of the directive. A positive integer indicates that the output should be flushright within the field, and a negative integer indicates the output should be flushleft within the field. If the output length is greater than the field’s width, then output occurs as if there were no field specification. The following are examples of valid format directives:

    %S
    %s
    %15D
    %-10=

The following describes the directives:

%S
%=
%C
%D
%B
%O
%X
%M
%%

Mindy Compiler Mindy Debugger Mindy Object Extensions Streams Library Standard IO Print Library Format Library Melange Interface TK Library Collection extensions Table Extensions String extensions Regular Expressions Transcendental Library Time Library Random Library Matrix Library

Previous Page TOC Index Next Page See Page

Copyright 1994, 1995, 1996, 1997 Carnegie Mellon University. All rights reserved.

Send comments and bug reports to gwydion-bugs@cs.cmu.edu