GNU Pascal Homepage - gpc - gpc-announce - gpc-de - gpc-doc
Diese Seite auf deutsch

Mail #494

Back to main page of archive

Previous mail   Next mail   Unformatted/full headers
Overview  10 days   Subject   Date   Thread   Author  

From: Jan-Jaap van der Heijden
Subject: GPC fails set comprare
Date: 8 Apr 1997, 14:53:06


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

Previous mail   Next mail   Unformatted/full headers
Overview  10 days   Subject   Date   Thread   Author  


Back to main page of archive


Note: This page contains information that does not originate from the owner of this web site, but from the authors of the mails archived. The owner of this web site is not responsible for the content of such information. Any use of that infomation requires the consent of the respective author.

Where WWW addresses (URLs) in the mails archived are marked as hyperlinks, this is only for the comfort of the reader. The content of the web pages linked to like this does not necessarily reflect the opinion of the owner of this web site or of the authors of the mails archived. The owner of this web site is not responsible for the content of such web pages. Those pages are explicitly not to be considered as part of the content of this page, but merely as references.


This page was created by Crystal 0.999 (Linux 2.4.27/i686).