diff options
author | dos-reis <gdr@axiomatics.org> | 2007-08-14 05:14:52 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2007-08-14 05:14:52 +0000 |
commit | ab8cc85adde879fb963c94d15675783f2cf4b183 (patch) | |
tree | c202482327f474583b750b2c45dedfc4e4312b1d /src/hyper/pages/CHAR.ht | |
download | open-axiom-ab8cc85adde879fb963c94d15675783f2cf4b183.tar.gz |
Initial population.
Diffstat (limited to 'src/hyper/pages/CHAR.ht')
-rw-r--r-- | src/hyper/pages/CHAR.ht | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/src/hyper/pages/CHAR.ht b/src/hyper/pages/CHAR.ht new file mode 100644 index 00000000..5bda343e --- /dev/null +++ b/src/hyper/pages/CHAR.ht @@ -0,0 +1,92 @@ +% Copyright The Numerical Algorithms Group Limited 1992-94. All rights reserved. +% !! DO NOT MODIFY THIS FILE BY HAND !! Created by ht.awk. +\newcommand{\CharacterXmpTitle}{Character} +\newcommand{\CharacterXmpNumber}{9.8} +% +% ===================================================================== +\begin{page}{CharacterXmpPage}{9.8 Character} +% ===================================================================== +\beginscroll + +The members of the domain \spadtype{Character} are values +representing letters, numerals and other text elements. +For more information on related topics, see +\downlink{`CharacterClass'}{CharacterClassXmpPage}\ignore{CharacterClass} and \downlink{`String'}{StringXmpPage}\ignore{String}. + +\xtc{ +Characters can be obtained using \spadtype{String} notation. +}{ +\spadpaste{chars := [char "a", char "A", char "X", char "8", char "+"] \bound{chars}} +} +\xtc{ +Certain characters are available by name. +This is the blank character. +}{ +\spadpaste{space()} +} +\xtc{ +This is the quote that is used in strings. +}{ +\spadpaste{quote()} +} +\xtc{ +This is the escape character that allows quotes and other characters +within strings. +}{ +\spadpaste{escape()} +} +\xtc{ +Characters are represented as integers in a machine-dependent way. +The integer value can be obtained using the \spadfunFrom{ord}{Character} +operation. +It is always true that \spad{char(ord c) = c} and \spad{ord(char i) = i}, +provided that \spad{i} is in the range \spad{0..size()\$Character-1}. +}{ +\spadpaste{[ord c for c in chars] \free{chars}} +} + +\xtc{ +The \spadfunFrom{lowerCase}{Character} operation converts an upper case +letter to the corresponding lower case letter. +If the argument is not an upper case letter, then it is returned +unchanged. +}{ +\spadpaste{[upperCase c for c in chars] \free{chars}} +} +\xtc{ +Likewise, the \spadfunFrom{upperCase}{Character} operation converts lower +case letters to upper case. +}{ +\spadpaste{[lowerCase c for c in chars] \free{chars}} +} + +\xtc{ +A number of tests are available to determine whether characters +belong to certain families. +}{ +\spadpaste{[alphabetic? c for c in chars] \free{chars}} +} +\xtc{ +}{ +\spadpaste{[upperCase? c for c in chars] \free{chars}} +} +\xtc{ +}{ +\spadpaste{[lowerCase? c for c in chars] \free{chars}} +} +\xtc{ +}{ +\spadpaste{[digit? c for c in chars] \free{chars}} +} +\xtc{ +}{ +\spadpaste{[hexDigit? c for c in chars] \free{chars}} +} +\xtc{ +}{ +\spadpaste{[alphanumeric? c for c in chars] \free{chars}} +} +\endscroll +\autobuttons +\end{page} +% |