Article View: net.lang.pascal
Article #83Bug in 4.2 BSD Pascal implementation ???
From: Russell Shilling
Date: Sat, 01 Sep 1984 00:15
Date: Sat, 01 Sep 1984 00:15
38 lines
2059 bytes
2059 bytes
[eat this, Sucker !!!]
Recently I've been trying to write introductory manuals for some
of the languages we have available, and in the process of converting a
Modula-2 program to Pascal I found an (apparent) error in the definition
of the Pascal language (we have 4.2 BSD.)
It seems that the "read" statement will allow reading past the end
of the current line and on to the next. Isn't this wrong, (at least as
far as the way the read was supposed to work) ???
As an example, the following code will not operate correctly
(as I understand the idea of correctness):
program ReadTest(input,output);
var C: char;
begin
repeat
while not eoln do begin (* should echo one line of chars *)
read(C); write(C);
end;
readln(C); (* supposed to be required to read past *)
writeln; (* end-of-line marker, right ??? *)
until eof;
end.
This program seems to work fine when you are reading from the
standard input, but if you redirect input from a file, every other line
is skipped. Perhaps I'm full of blue mud, but I thought that you could
"read" forever without reading past the end of line. Can someone explain
either where my misconception of the language definition is, or maybe
verify that this is a legitimate bug ?
--
Russell Shilling
{ allegra, ihnp4, seismo }!scgvaxd!muddcs!russell
===== plplplplplplplplplplplplplplplplplp =====
Technical Details
Message-ID:
<223@muddcs.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxl!houxm!vax135!cornell!uw-beaver!tektronix!hplabs!sdcrdcf!trwrb!scgvaxd!muddcs!russellShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site muddcs.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxl!houxm!vax135!cornell!uw-beaver!tektronix!hplabs!sdcrdcf!trwrb!scgvaxd!muddcs!russell From: russell@muddcs.UUCP (Russell Shilling) Newsgroups: net.lang.pascal,net.bugs Subject: Bug in 4.2 BSD Pascal implementation ??? Message-ID: <223@muddcs.UUCP> Date: Fri, 31-Aug-84 20:15:24 EDT Article-I.D.: muddcs.223 Posted: Fri Aug 31 20:15:24 1984 Date-Received: Mon, 3-Sep-84 11:09:18 EDT Organization: Harvey Mudd College, Claremont, CA Lines: 38