🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.micro.mac
Article #489

IMPORTANT: MacPascal (1.0) BUG

#489
From: Steve Hawley
Date: Sat, 26 Jan 1985 01:00
72 lines
1903 bytes
Attention world!

There is a major bug in MacPascal.

According to the Pascal Reference manual the foolowing type 
declarations are equivalent:

mat : array[1..2] of array[1..2] of integer;

mat1 : array[1..2,1..2] of integer;

They are only equivalent in theory.

In practice the first structure (which I prefer as it lends greater 
readability to the code) is a valid statement, but any results using
such a matrix are incorrect.

Consider this program

Program testmat;

type foomat = array[1..4] od array[1..4] of Integer;

var foobar : foomat;
    x,y : Integer {Indexes}

begin
  for x := 1 to 4 do
     begin
        for y := 1 to 4 do
            begin
              foobar[x][y] := x;
              write(foobar[x][y] : 1)
            end;
        writeln
     end;
   for x := 1 to 4 for do
      begin
         for y := 1 to 4 do
            write(foobar[x][y] : 1);
         writeln
      end
end.

The EXPECTED ouput should be:
1111
2222
3333
4444
1111
2222
3333
4444

The output is in fact:
1111
2222
3333
4444
1234
2344
3444
4444

Try to pin that bug down if the natrix is have messy 3D rotation and
projection formulae run through it!

I sincerely hope Apple gets this one fixed, or at least releases
a compiler based Pascal to save memory and decrease execution time.

Steve Hawley
decvax!ucbvax!research!alice!sdh
Technical Details
Message-ID: <3341@alice.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!alice!sdh

Show 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 alice.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!alice!sdh
From: sdh@alice.UUCP (Steve Hawley)
Newsgroups: net.micro.mac
Subject: IMPORTANT: MacPascal (1.0) BUG
Message-ID: <3341@alice.UUCP>
Date: Fri, 25-Jan-85 20:00:04 EST
Article-I.D.: alice.3341
Posted: Fri Jan 25 20:00:04 1985
Date-Received: Mon, 28-Jan-85 05:03:34 EST
Organization: Bell Labs, Murray Hill
Lines: 72