gm2
[Top][All Lists]
Advanced

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

ReadCard and ReadInt from WholeIO have problems with leading space


From: Rudolf Schubert
Subject: ReadCard and ReadInt from WholeIO have problems with leading space
Date: Fri, 12 May 2023 14:30:59 +0200 (CEST)

Hi Gaius,

there is absolutely no need for you to apologize if you missed one
of my 'bug mails'. On the contrary, it's me nearly feeling bad
constantly delivering 'bad news'! In fact I appreciate your project
very much and are very confident that, say around 2038 (that's the
time when my old GPM version will wrap time!), GM2 will be the best
Modula compiler in the world;-)

But nonetheless I come with a new bug report. This time it's a leading
space when reading INTEGERs (or CARDINALs) which seems to cause trouble.
Please see attached test program port_test10a_gm2.mod.

With GPM my output is this:

write (INTEGER) numbers to file...
read numbers with ReadCard...
123
234

read numbers with ReadInt...
123
234


But with GM2 I see this:

write (INTEGER) numbers to file...
read numbers with ReadCard...
0
234

read numbers with ReadInt...
+4302659
+234

One obvious difference between GPM and GM2 is the leading '+' with WriteInt.
GPM does NOT put a leading '+' whereas GM2 does. This is probably because the
'ISO wording' is not quite clear if this leading '+' is mandatory or in the
case of positive values might be optional as is usual with 'everyday 
mathematics'.

But the 'real' problem here is the first number (123) with the leading space.
There ReadCard as well as ReadInt seem to get confused and do not simply 'skip
leading space'.


BR

Rudolf

--
Rudolf Schubert                 \
Kirchstr. 18a                    \  mailto:rudolf@muc.de
82054 Sauerlach                   > http://www.dose.muc.de
Deutschland                      /
Tel. 08104/908311               /

Attachment: port_test10a_gm2.mod
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]