[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Character and output-width proposals



  Proposal:

I propose that #\tab and #\page be added to the examples in Section
6.6 Characters.

  Motivation:

The characters #\space and #\newline seem to be universally supported
by implementations (at least those which have run test.scm) because of
their appearence in the report.  Code for format in SLIB has to have
definitions for each implementation for the tab and form-feed
characters.  Standardizing on the names would allow them to be used in
CASE statements (where variables can't be used).

Using the actual tab and page characters in the #\ construction can
cause problems with shar, some mailers, and other programs.

This proposal would not require that tab and page print as #\tab and
#\page, just that they be read that way.

Tab and form-feed are part of both the ASCII and EBCDIC character
sets.

  Variations on the proposal:

#\tab and #\page could be called other names.
----------------------------------------------------------------------
  Proposal:

  char-code-limit					constant

Is an integer 1 larger that the upper bound of the values which can be
returned by char->integer.

  char-code-lower-limit					constant

Is the lower bound of the values which can be returned by
char->integer.

  Motivation:

There are algorithms (for instance, variable orderings for Grobner
bases) which require knowing the bounds of the character set.

One could argue that the program should just take the max of all the
characters the programmer can think of; But suppose a program is
created in the USA and then used in Finland.  Finnish uses alphabetic
characters like (integer->char #O344) which the American has never
heard of.  Either the Fin doesn't get to spell his name properly, or
the program breaks.

  Variations on the proposal:

If char->integer were restricted to returning non-negative numbers
char-code-lower-limit would be unneccessary.
----------------------------------------------------------------------
  Proposal:

  (output-port-width <port>)				procedure

Returns the width in characters of output port <port> or 0 if <port>
does not have a width.

  Motivation:

Many programs (especially interactive ones) produce output intended to
be viewed by a user.  The device on which the output is viewed usually
has a finite width.  If this width is available to a program, output
which is better suited to the device can be produced.

  Variations on the proposal:

#f could be returned instead of 0 if <port> does not have a width.