From Newsgroup: comp.lang.misc
Reading Lindsay / van der Meulen [*] I stumbled across the following
transput description:
"When print is called, the mode of each item to be printed is
identified, and appropriate action taken as follows:
ints, reals, compls:
If there is not room for the item on the current line (page),
then newline (newpage) is called. Then the item is printed,
_preceded by a space_ (if not at the beginning of a line),
allowing sufficient positions to cope with the largest
permissible value of that mode."
(Emphasis by me.) I assume that describes standard behavior.
Alas, with Genie I get for example with
BEGIN
INT a = 123, b = -45678, c = 9;
INT d = max int, e = -max int, f = 0;
REAL x = 1.3, y = 456e78, z = .9;
COMPL r = d I e;
print ((a, b, c, newline));
print ((d, e, f, newline));
print ((x, y, z, newline));
print ((r, newline))
END
this output
+123 -45678 +9 +9223372036854775807-9223372036854775807 +0
+1.30000000000000e +0+4.56000000000000e +80+9.00000000000000e -1 +9.22337203685477e +18-9.22337203685477e +18
instead of, say, (mind the data-separating spacing)
+123 -45678 +9 +9223372036854775807 -9223372036854775807 +0 +1.30000000000000e +0 +4.56000000000000e +80 +9.00000000000000e -1 +9.22337203685477e +18 -9.22337203685477e +18
or, for the last line with the complex number, even
+9.22337203685477e +18 i -9.22337203685477e +18
I think such spacing would be quite useful since I noticed that in
simple, mostly test tools I want that spacing between numeric data.
And I always (have to) add 'blank' tokens anyway to make it somewhat
readable.
As a non-native speaker I'm not sure whether "preceded by _a_ space"
means all the padding spaces. I interpreted it as "a [one] space" to
separate the numbers; formatting trash like "...000e +0+4.560..."
in the example above would thus be alleviated; at least a bit.
I think, though, that indeed an additional separating space is meant
(otherwise the padding of "+123" at the start of the line above would
make no sense in the light of the quoted formulation).
Note: I'm just asking because I stumbled across the statement in the
document, and because I suffered from Genie's behavior; so I'd liked
some clarification. - The Genie docs have a lot of "deviations" from
the standard concerning transput, but this is not mentioned (presuming
that I didn't misinterpreted the Lindsey documents in the first place).
Janis
[*]
https://inria.hal.science/hal-03027689/file/Lindsey_van_der_Meulen-IItA68-Revised.pdf
--- Synchronet 3.21a-Linux NewsLink 1.2