comp.lang.ada
 help / color / mirror / Atom feed
From: Preben Randhol <randhol+abuse@pvv.org>
Subject: Re: Relational Operators
Date: Fri, 26 Oct 2001 13:57:17 +0000 (UTC)
Date: 2001-10-26T13:57:17+00:00	[thread overview]
Message-ID: <slrn9tj29n.4ne.randhol+abuse@kiuk0156.chembio.ntnu.no> (raw)
In-Reply-To: 3BD959E1.6C0AD647@hotmail.com

On Fri, 26 Oct 2001 13:41:05 +0100, Gordon Cooke wrote:
> Is this code legal?
> 
> procedure Test is
>    B : Boolean;
> begin
>    B := True = True = True;
> end Test;

Consider:

B := True = 5 = 5;

If you write it as:

B := (True = 5) = 5;

you will get at compile time:

tests.adb:6:16: invalid operand types for operator "="
tests.adb:6:16: left operand has type universal integer
tests.adb:6:16: right operand has type "Standard.Boolean"

but change it to:

B := True = (5 = 5);

and it will be legal.

Preben



  reply	other threads:[~2001-10-26 13:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-26 12:41 Relational Operators Gordon Cooke
2001-10-26 13:57 ` Preben Randhol [this message]
2001-10-26 14:42   ` Ted Dennison
2001-10-26 14:10 ` Ted Dennison
2001-10-29  8:44   ` tgingold
2001-10-29 10:47     ` Martin Dowie
2001-10-29 13:41       ` Pascal Obry
2001-10-29 19:31       ` David Starner
2001-10-30  9:02         ` Martin Dowie
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox