Deutsch   English   Français   Italiano  
<vlcbrr$2ito3$1@news.xmission.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!3.eu.feeder.erje.net!2.eu.feeder.erje.net!feeder.erje.net!weretis.net!feeder9.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gazelle@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.lang.tcl,comp.unix.shell,comp.editors
Subject: The "leading zero means octal" thing...
Date: Sat, 4 Jan 2025 22:14:19 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <vlcbrr$2ito3$1@news.xmission.com>
Injection-Date: Sat, 4 Jan 2025 22:14:19 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
	logging-data="2717443"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
Bytes: 2247
Lines: 28

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.

In fact, the really obnoxious part about it is that it means a number
string like "08" is invalid, because 8 is not a valid digit in octal.  I
wish there was a global way to turn this off - some option to set that says
"Don't do that!".  I realize, of course, that it has to be on by default,
but it should be possible to turn it off.

Incidentally, and this was my motivation for posting this rant, I hit this
in VIM - where if the cursor is sitting on the zero in a string like Foo07
and you hit ^A, it changes it to - are you ready? - not Foo08, but Foo010.

Totally weird and unexpected.

-- 
Just like Donald Trump today, Jesus Christ had a Messiah complex.

And, in fact, the similarities between the two figures are quite striking.
For example, both have a ragtag band of followers, whose faith cannot be shaken.