Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Bender
May 12, 2001

Fun Shoe
Ada question:

code:
with Ada.Real_Time;
...
Poll_Time  : Ada.Real_Time.Time;
Period     : constant Ada.Real_Time.Time_Span := 
                          Ada.Real_Time.Milliseconds(10);
...
-- Not sure why this won't compile
Poll_Time := Ada.Real_Time.Clock;
delay until Poll_Time + Period;
...
This won't compile, because it claims that there is no specification for the "+" operator. Looking through the Ada.Real_Time package, the "+" definitely is overloaded for both Time types on the left and Time_Span types on the right, and vice versa.

I've withed Ada.Real_Time, it knows the types, but it's ignoring the overloading for some reason. I've just started learning Ada for this project at work, so if I'm missing something completely obvious, then I wouldn't be surprised.

Adbot
ADBOT LOVES YOU

Bender
May 12, 2001

Fun Shoe

more falafel please posted:

Congratulations on having the first Ada question in CoC, to the best of my knowledge.

Looks like it will be the last Ada question, too.

For those 15 years from now who search this thread and maybe would like a stop-gap solution, I was able to get Ada.Real_Time."+"(Poll_Time, Period) to work. Don't ask me why the normal way doesn't work, because I have no clue.

Bender fucked around with this message at 00:35 on Mar 18, 2008

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply