comp.lang.ada
 help / color / mirror / Atom feed
From: Shark8 <onewingedshark@gmail.com>
Subject: Re: Tasking troubles, unexpected termination.
Date: Tue, 30 Oct 2012 19:59:32 -0700 (PDT)
Date: 2012-10-30T19:59:32-07:00	[thread overview]
Message-ID: <5d418014-3796-422d-9393-6ee1c65746a5@googlegroups.com> (raw)
In-Reply-To: <d1a43289-8da0-4b79-be63-b79108483b00@googlegroups.com>

The following edit gives expected behavior:
--------------------------------------------------------------
    For Index in 1..10 loop
	declare
	    Use Ada.Calendar;
	    Function Alert Return Ada.Calendar.Time is
		( Now + Duration(1.5*Index) );
            -- Removed Item declaration in favor of building in-place.
	begin
	    K.Add( Event => New Notification'(
			 Message => + ("DD"&Positive'Image(Index)),
			 -- Expire at Now and 3*Index seconds.
			 Expiry  => New Time'( Alert )
			)
	  );
	end;
    end loop;
--------------------------------------------------------------
Though this raises the question of why the other behavior is executed with:
	    Item  : Notification:=
	      Notification'(
			 Message => + ("DD"&Positive'Image(Index)),
			 -- Expire at Now and 3*Index seconds.
			 Expiry  => New Time'( Alert )
			);
            [...]
	    K.Add( Event => New Notification'(Item) );



  reply	other threads:[~2012-10-31  2:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-30 22:03 Tasking troubles, unexpected termination Shark8
2012-10-30 23:01 ` Adam Beneschan
2012-10-31  1:05   ` Anh Vo
2012-10-31  2:17     ` Shark8
2012-10-31  2:59       ` Shark8 [this message]
2012-11-02 16:02         ` Anh Vo
2012-11-01  9:39 ` AdaMagica
2012-11-02  1:18   ` Shark8
2012-11-02 16:43     ` Adam Beneschan
2012-11-02 16:51       ` Shark8
replies disabled

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