Sujet : Re: The "leading zero means octal" thing...
De : saitology9 (at) *nospam* gmail.com (saito)
Groupes : comp.lang.tcl comp.unix.shell comp.editorsDate : 05. Jan 2025, 22:35:27
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vletuv$17djb$1@dont-email.me>
References : 1
User-Agent : Mozilla Thunderbird
On 1/4/2025 5:14 PM, Kenny McCormack wrote:
First of all, yes, I know this is all standardized and it is based on
legacy C conventions and it can't be changed and so on and so forth.
But if not a bug, it is certainly a misfeature.
I am referring, of course, to the convention that a number with a leading
zero is interpreted as octal. I can't count the number of times I've been
bitten by this - in various languages/environments all across the Unix
ecosystem. Note the choice of newsgroups above - I have been affected by
this in each of these environments - most recently in Tcl (Expect) and in
the VIM editor.
I can't help but think that this may be related to your post regarding time calculation. I had left this quote in my reply:
There is an interesting "octal" problem left as an exercise 🙂
This was exactly the exercise as well. "clock format" leaves leading zeros in the result depending on what time it was. It is missing "string trimleft" calls which I'd discovered after some test runs before posting.