GPC fails set comprare

Tue, 8 Apr 1997 14:53:06 +0100 (WET DST)



Hello,

Consider this little program:

--------------------------------------------------------------
program main(input,output);
var
	o, z: set of 1..15;
begin
	o := [1];
	z := [];
	if o < z then
		writeln('o < z');
	if o <= z then
		writeln('o <= z');
	if o = z then
		writeln('o = z');
	if o <> z then
		writeln('o <> z');
	if o >= z then
		writeln('o >= z');
	if o > z then
		writeln('o > z');
	if z < o then
		writeln('z < o');
	if z <= o then
		writeln('z <= o');
	if z = o then
		writeln('z = o');
	if z <> o then
		writeln('z <> o');
	if z >= o then
		writeln('z >= o');
	if z > o then
		writeln('z > o');
	if o < o then
		writeln('o < o');
	if o <= o then
		writeln('o <= o');
	if o = o then
		writeln('o = o');
	if o <> o then
		writeln('o <> o');
	if o >= o then
		writeln('o >= o');
	if o > o then
		writeln('o > o');
	if z < z then
		writeln('z < z');
	if z <= z then
		writeln('z <= z');
	if z = z then
		writeln('z = z');
	if z <> z then
		writeln('z <> z');
	if z >= z then
		writeln('z >= z');
	if z > z then
		writeln('z > z');
end.
--------------------------------------------------------------

GPC fails to compile this:

t19.p: In function Program_Main':
t19.p:7: invalid operands to binary <
t19.p:17: invalid operands to binary >
t19.p:19: invalid operands to binary <
t19.p:29: invalid operands to binary >
t19.p:31: invalid operands to binary <
t19.p:41: invalid operands to binary >
t19.p:43: invalid operands to binary <
t19.p:53: invalid operands to binary >

ISO 7185 sec. 6.7.1 suggests that this should work.

The correct output should be:

o <> z
o >= z
o > z
z < o
z <= o
z <> o
o <= o
o = o
o >= o
z <= z
z = z
z >= z

Greetings, 
JanJaap

---
  The nice thing about standards is that there are so many to choose from
  -
  Andrew Tanenbaum




Jan-Jaap van der Heijden (janjaap@wit381304.student.utwente.nl)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es