comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam@spam.com>
Subject: Re: I don't know what the compiler wants to tell me
Date: Fri, 04 Nov 2005 05:12:12 GMT
Date: 2005-11-04T05:12:12+00:00	[thread overview]
Message-ID: <M4Caf.5446$Rl1.4529@newsread1.news.pas.earthlink.net> (raw)
In-Reply-To: <20051103214759.6d049f90@localhost>

Thomas Ruschival wrote:

> hello2b.adb:48:18: left hand of assignment must not be limited

What it means is that assignment (":=") is not defined for limited types. Task 
types are limited types.

>       while Irq = False  -- infinite loop until an external task does 

This (Irq = False) generally indicates a lack of understanding of Booleans. 
Better is

while not Irq loop

That uses negative logic. Positive logic is easier to understand than negative, so

loop
    exit when Irq;

is better still. However, best is to eliminate Irq altogether and have

loop
    ...
    select
       accept Interrupt;

       exit;
    or
    ...
end loop;

Often, naming loops can make them easier to read and understand:

Wait_For_Interrupt : loop
    ...
    exit Wait_For_Interrupt;
    ...
end loop Wait_For_Interrupt;

> 	  Controlled : PrinterTask; -- task To be controlled

Controlled is an object of a task type; an object of a task type is a task.

> 		 Controlled := ToControl;

This is illegal, because Controlled is limited.

-- 
Jeff Carter
"Now go away or I shall taunt you a second time."
Monty Python & the Holy Grail
07



  parent reply	other threads:[~2005-11-04  5:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-03 20:47 I don't know what the compiler wants to tell me Thomas Ruschival
2005-11-03 22:39 ` jimmaureenrogers
2005-11-08  8:43   ` Thomas Ruschival
2005-11-08 19:30     ` Ada books (was: I don't know what the compiler wants to tell me) Björn Persson
2005-11-04  5:12 ` Jeffrey R. Carter [this message]
2005-11-04  9:14   ` I don't know what the compiler wants to tell me Lurker
2005-11-04 17:55     ` Martin Krischik
2005-11-07  8:32       ` Maciej Sobczak
replies disabled

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