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

Liste des GroupesRevenir à cl tcl 
Sujet : Re: The "leading zero means octal" thing...
De : luc (at) *nospam* sep.invalid (Luc)
Groupes : comp.lang.tcl
Date : 06. Jan 2025, 00:13:01
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20250105201301.1fe87ba4@lud1.home>
References : 1 2 3
On Sun, 5 Jan 2025 21:04:46 -0000 (UTC), Rich wrote:

Luc <luc@sep.invalid> wrote:
I updated my 'seq' code because of this thread:
 
https://wiki.tcl-lang.org/page/seq 
>
And, line one of the proc contains the common Tcl bug of "applying a
string operator" to a tcl list.

**************************

While I admit that I never took the list to string conversion into
consideration (I am repeat offender at that), you explore certain
possibilities in your exposition that I did take into consideration,
and I decided that those don't matter.

Anyone who has ever used seq (or just merely understands it in spite
of never having used it) knows what the input is supposed to be: two
or three integers.

I improved on it by adding the ability to produce alphabetic sequences.

About your examples, being atypically blunt, no programmer is stupid
enough to input 08 and 08. Even I wouldn't that. Likewise, no programmer
will be stupid enough to input #08. And if anyone actually does that,
they will get the empty string. The code intentionally refuses to
produce output when the input is incorrect.

Of course, we have to consider the possibility of input being generated
by some other code, which makes it more unpredictable. But then the
blame will fall upon the code that produces incorrect input, and
whoever writes (and hopefully tests) such code will have to make sure
that the input is always correct. I can't blame the authors of the
list and string commands to be responsible for my repeated incorrect
use of lists and strings.

But of course I am glad you chimed in once again because I was getting
wrong outputs for '08 08' and '08 09'. I also noted another bug that
you didn't point out: 'p.seq 0 5' was outputting '1 2 3 4 5' without
the zero, which was also incorrect.

So thanks to you, I have updated the code once again.

Thank you.

--
Luc
>


Date Sujet#  Auteur
4 Jan 25 * The "leading zero means octal" thing...23Kenny 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...7Luc
5 Jan 25 i`* Re: The "leading zero means octal" thing...6Rich
6 Jan 25 i `* Re: The "leading zero means octal" thing...5Luc
6 Jan 25 i  +- Re: The "leading zero means octal" thing...1Rich
6 Jan 25 i  `* Re: The "leading zero means octal" thing...3Rich
6 Jan 25 i   `* Re: The "leading zero means octal" thing...2Luc
6 Jan 25 i    `- Re: The "leading zero means octal" thing...1Rich
5 Jan 25 +* Re: The "leading zero means octal" thing...4saito
5 Jan 25 i`* Re: The "leading zero means octal" thing...3Kenny McCormack
6 Jan 25 i `* Re: The "leading zero means octal" thing...2Rich
6 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