say - prints the UTF-8 representation of values based on default formatting rules
say(
val, ...)
say(
file, val, ...)
file.say(
val,
...)
Prints out a UTF-8 representation of each value on the given
file. If the file is not specified, prints to
io::Output
. The values are printed using the
equivalent of the print
V
format. Additional control over printing may be
specified via the following OADL global variables (all found in
namespace io
):
Variable | Default | Description |
---|---|---|
FieldWidth | nil |
If non-nil , specify the field width |
FltFormatChar | 'V' |
Format to use for floating point numbers |
IntFormatChar | 'V' |
Format to use for integer numbers |
IntRadix | nil |
If non-nil , specify the radix to use for
integers |
MonetaryFill | ' ' |
Character to fill empty spaces in 'M' format |
NumDigits | nil |
If non-nil , specify the precision of
numeric formats |
NumExponent | nil |
If non-nil , specify the number of exponent
digits |
FormatFlags | 0 |
See flags table below |
The io::FormatFlags
variable may include any
of the following bits (again, all found in namespace
io
)::
Flag | Format Equiv. |
Description |
---|---|---|
FMT_ADD_BLANK | SB |
Add a blank before positive numbers |
FMT_ADD_PLUS | SP |
Add a '+' before positive numbers |
FMT_ADD_TYPE | SV |
Add type information prefix/suffix and quotes |
FMT_ALIGN_ROWS | SN| |
Align rows horizontally between values |
FMT_LEFT | SL |
Left-justify values in fields |
FMT_CENTER | SC |
Center values in fields |
FMT_INTERNAT | SI |
Use international monetary symbols |
FMT_NO_BOX_ARR | SN# |
Disable box output around arrays |
FMT_THOUSANDS | ST |
Add thousands separator |
FMT_UNSIGNED | SU |
Treat integers as unsigned |
FMT_UPPER_CASE | Upper-case formats | Print numeric and boolean values entirely in upper-case |
FMT_FORCE_WIDE | SW |
Force wide-char output (especially useful for nested array output) |
Note that the default for row alignment (disabled) is the
opposite of the print()
intrinsic.
None
AccessCheck
for an attempt to access a closed
file
IoCheck
for other
miscellaneous I/O errors (see ferror)
"This is an implicit say()" This is an implicit say say({'1','2','3'},{'a','b','c'}}) +-----+ +-----+ |1 2 3| |a b c| +-----+ +-----+ // Including non-ASCII forces Unicode box-drawing glyphs say({'1','2','3'},{'\x0251','\x03b2','\x0263'}}) ┌─────┐ ┌─────┐ │1 2 3│ │ɑ β ɣ│ └─────┘ └─────┘ // Force box drawing glyphs without non-ASCII chars io::FormatFlags =io::FMT_FORCE_WIDE say({'1','2','3'},{'a','b','c'}}) ┌─────┐ ┌─────┐ │1 2 3│ │a b c│ └─────┘ └─────┘ // Print float with thousands separator io::FltFormatChar = 'F' io::FormatFlags = io::FMT_THOUSANDS 1234567. 1,234,570. // Print numbers as 2-digit hex io::NumDigits = 2 io::IntFormatChar = 'Z' [10, 20, 30] 0a 14 1e