Thread View: net.micro.mac
1 messages
1 total messages
Started by Steve Hawley
Sat, 26 Jan 1985 01:00
IMPORTANT: MacPascal (1.0) BUG
Author: Steve Hawley
Date: Sat, 26 Jan 1985 01:00
Date: Sat, 26 Jan 1985 01:00
72 lines
1903 bytes
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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads