Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!harvard!topaz!hedrick From: hedrick@topaz.RUTGERS.EDU (Charles Hedrick) Newsgroups: net.lang.pascal Subject: Re: SUN pascal Message-ID: <4919@topaz.RUTGERS.EDU> Date: Mon, 5-May-86 22:27:05 EDT Article-I.D.: topaz.4919 Posted: Mon May 5 22:27:05 1986 Date-Received: Thu, 8-May-86 07:26:19 EDT References: <557@bu-cs.UUCP> Organization: Rutgers Univ., New Brunswick, N.J. Lines: 26 a : 0 .. 100; i := 0; for a := 0 to i-1 The standard says that the lower and upper bounds must be assignment compatible with the control variable if the statement is executed. In this case, the loop is from 0 to -1, so the loop is not executed. Thus the compatibility test is not to be enforced. This code is therefor legal. i : -128 .. 127; i := 10; c := chr (i); The standard says that the argument to chr must be compatible with integer, which it is. The actual value passed must translate to a legal character, or it is an error. It is up to the implementation as to what characters are legal. At first glance, I would say that 10 is a legal character. The only excuse I can think of is that 10 is really a linefeed. One might take the view that linefeed is not a legal character in a Unix implementation of Pascal, since it can never be read. Read will treat it as an end of line marker and turn it into a blank. I suggest trying the same program with a value of i that is some printable character. Incidentally, your table showed that TOPS-20 Pascal rejects the first example. That was a bug, and was fixed on 29-Jan-84.