Re: The "leading zero means octal" thing...

Liste des GroupesRevenir à cu shell 
Sujet : Re: The "leading zero means octal" thing...
De : saitology9 (at) *nospam* gmail.com (saito)
Groupes : comp.lang.tcl comp.unix.shell comp.editors
Date : 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.

Date Sujet#  Auteur
4 Jan 25 * The "leading zero means octal" thing...14Kenny McCormack
4 Jan 25 +* Re: The "leading zero means octal" thing...2Janis Papanagnou
5 Jan 25 i`- Re: The "leading zero means octal" thing...1Kenny McCormack
5 Jan 25 +* Re: The "leading zero means octal" thing...2Rich
5 Jan 25 i`- Re: The "leading zero means octal" thing...1Kenny McCormack
5 Jan 25 +* Re: The "leading zero means octal" thing...5Eli the Bearded
5 Jan 25 i`* Re: The "leading zero means octal" thing...4Kenny McCormack
5 Jan 25 i `* Re: The "leading zero means octal" thing...3Kenny McCormack
5 Jan 25 i  +- 'nf' in VIM (Was: The "leading zero means octal" thing...)1Kenny McCormack
5 Jan 25 i  `- Re: The "leading zero means octal" thing...1Janis Papanagnou
5 Jan 25 +- Re: The "leading zero means octal" thing...1Joe Makowiec
5 Jan 25 +* Re: The "leading zero means octal" thing...2saito
5 Jan 25 i`- Re: The "leading zero means octal" thing...1Kenny McCormack
6 Jan 25 `- Re: The "leading zero means octal" thing...1Eric Pozharski

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal