## number-string.api
# Compiled by:
#
src/lib/std/src/standard-core.sublib### "It is dangerous to be right when the government is wrong."
###
### -- Voltaire
# This api is implemented in:
#
src/lib/std/src/number-string.pkgapi Number_String {
#
Radix = BINARY
| OCTAL | DECIMAL | HEX;
Float_Format
= EXACT
| SCI Null_Or( Int )
# "Scientific" (exponential) notation.
| FIX Null_Or( Int )
# Fixed-point notation.
| GEN Null_Or( Int )
# Either of the above, as appropriate.
;
# A Reader accepts a stream Y (typically a stream of of Char),
# reads some value from it (say, an integer), and returns
# that value plus the remainder of the stream:
#
Reader( X, Y )
=
Y -> Null_Or( (X, Y) );
pad_left: Char -> Int -> String -> String; # Pad String to width Int by adding copies of Char on the left.
pad_right: Char -> Int -> String -> String; # Pad String to width Int by adding copies of Char on the right.
split_off_prefix: (Char -> Bool) -> Reader( Char, X ) -> X -> (String, X);
get_prefix: (Char -> Bool) -> Reader( Char, X ) -> X -> String;
drop_prefix: (Char -> Bool) -> Reader( Char, X ) -> X -> X;
skip_ws: Reader( Char, X ) -> X -> X;
Char_Stream;
scan_string
: (Reader( Char, Char_Stream ) -> Reader( X, Char_Stream ))
-> String
-> Null_Or(X);
};
## COPYRIGHT (c) 1995 AT&T Bell Laboratories.
## Subsequent changes by Jeff Prothero Copyright (c) 2010-2015,
## released per terms of SMLNJ-COPYRIGHT.