| Ticket UUID: | cd25761979da7be2861f124c41956cb0f9945ca4 | ||
| Title: | clock command - "now" vs "-now" | ||
| Type: | Bug | Created on: | 2024-07-25 12:52:45 |
| Submitter: | oehhar | Assigned to: | nobody |
| Subsystem: | 16. Commands A-H | Severity: | Minor |
| Priority: | 5 Medium | Last modified: | 2024-07-28 19:52:15 |
| Status: | Closed | Closed by: | sebres |
| Resolution: | Fixed | Closed on: | 2024-07-28 19:52:15 |
| Version: | main | ||
| Description: | ||||
|
Ashok wrote the following message on the core list: % clock scan now 1721803544 % clock format now bad seconds "now": must be -now or integer % clock format -now The above seems incongruous to me, why -now for format and “now” for scan? Afaict, “-now” is really a value, not an option. And unlike options, it cannot appear at arbitrary points in the command, only in place of the time value. Is there a rationale for the difference? If no, is it too late to change for 9.0? If too late for compatibility reasons, can clock format and clock add treat “now” and “-now” as synonyms with latter deprecated? (With a TIP of course) | ||||
| User Comments: | ||||
oehhar added on 2024-07-25 12:58:16:
Ashok, great to find that. The TIP https://core.tcl-lang.org/tips/doc/trunk/tip/688.md only writes about "-now" not "now". Thanks for branch [b5e6612557] I am also with you, that just "now" looks nicer. Thank you, Harald sebres added on 2024-07-26 19:02:29:
The new clock engine introduces new pseudo seconds value as quasi "option" This is also described in the TIP.
Just note that only free-scan form of Anyway both have nothing to do with each others (one is a base value to format, add etc, another is a user input to scan). > Afaict, “-now” is really a value, not an option. Well, matter of taste probably. One can consider it as an option so that then commands However, I'm not against can to treat oehhar added on 2024-07-27 12:25:12:
Sergey, thank you for the explanation. That makes sense. I hope, I did not disturb you within your holidays... Thanks again, Harald sbron added on 2024-07-27 19:56:44:
I have to disagree. It doesn't make sense. The Why introduce such a complicated set of rules when it could suffice to say that "the word 'now' may be used for timeVal to mean the current time". So I definitely would say that "now" should at least be accepted in all the places where "-now" has recently been introduced. I also think that "-now" should be deprecated as soon as possible, because we should get rid of things that are not logical. In my opinion, "-now" deserves that qualification. apnadkarni added on 2024-07-28 16:48:34:
I'm with Schelte on this one for exactly the reasons he described. It doesn't matter what the context for usage; in the user's mind it refers to current time and having to remember where to use "now" and where to use "-now" is unnecessary and confusing. If "-now" needs to be maintained as a synonym for some reason (compatibility with 9.0 beta releases?) we can just leave it undocumented. sebres added on 2024-07-28 19:52:15:
Fixed in [f602e32fc37910d1] for 8.7+, value | ||||
