Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time_First is 0.0 #33

Closed
simonjwright opened this issue Dec 5, 2020 · 1 comment
Closed

Time_First is 0.0 #33

simonjwright opened this issue Dec 5, 2020 · 1 comment
Labels

Comments

@simonjwright
Copy link
Owner

You’d expect Ada.Real_Time.Time_First to be quite a long time before any possible value of Ada.Real_Time.Clock; but in fact the system starts with Clock equal to Time_First.

This leads to clumsiness such as

         Quad_Is_Flying :=
           Last_Flight_Command_Time /= Ada.Real_Time.Time_First
             and then
           Ada.Real_Time.To_Duration (Now - Last_Flight_Command_Time)
             < In_Flight_Time_Threshold;
@simonjwright
Copy link
Owner Author

Following conversations on comp.lang.ada, & private communications, this change seems like a Bad Idea.

If you need a flag, use a boolean and stay away from sentinel values.
Much safer, explicit, and the extra cost is negligible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant