Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

manual entry for [string trim]

55 views
Skip to first unread message

Ricardo kozmate.net

unread,
Sep 2, 2019, 6:35:43 PM9/2/19
to
Hi all.

The manual entry for [string trim], [string trimleft], and [string
trimright], <http://www.tcl.tk/man/tcl8.6/TclCmd/string.htm#M47>, says,
quote:

[...] (any character for which *string is space* returns 1, and " ").

end quote.

IS this correct? That is, as far as I can see [string is space " "]
returns 1, so the sentence should simply be

[...] (any character for which *string is space* returns 1).

? Or is that " " supposed to be something other than a \x20 space?


--
(sample session, under Emacs @ Linux, OpenSuse, 64 bits)
wish TCL 8.6.7

tcl> string is space " "
1
tcl> string is space \x20
1

--
{ricardo from kozmate.net}

lj

unread,
Sep 2, 2019, 9:00:37 PM9/2/19
to
Ricardo kozmate.net wrote:
> Hi all.
>
> The manual entry for [string trim],  [string trimleft], and  [string
> trimright], <http://www.tcl.tk/man/tcl8.6/TclCmd/string.htm#M47>, says, quote:
>
> [...] (any character for which *string is space* returns 1, and " ").
>
> end quote.
>
> IS this correct? That is, as far as I can see [string is space " "] returns 1,
> so the sentence should simply be
>
> [...] (any character for which *string is space* returns 1).
>
> ? Or is that " " supposed to be something other than a \x20 space?

Yes. It is supposed to read:
any character for which *string is space* returns 1, and "\0".
Oops.

Uwe Klein

unread,
Sep 3, 2019, 5:14:48 AM9/3/19
to
Am 03.09.2019 um 03:00 schrieb lj:
> string is space

https://en.wikipedia.org/wiki/Whitespace_character#Unicode

lots of "is space" in unicode

Uwe

Donal K. Fellows

unread,
Sep 3, 2019, 10:03:53 AM9/3/19
to
On 02/09/2019 23:35, Ricardo kozmate.net wrote:
> Or is that " " supposed to be something other than a \x20 space?

Checking the actual definition of the default trim set, it's supposed to
be an indication of a NUL character (\u0000). Apparently, when the docs
were updated, the author didn't know that \0 means something special to
nroff, so the NUL indication they put in produces a space... which is
exactly what was confusing you.

Updated so that it will display as "\0". Website will be updated the
next time a build of the docs is pushed.

Donal.
--
Donal Fellows — Tcl user, Tcl maintainer, TIP editor.

Ricardo kozmate.net

unread,
Sep 8, 2019, 7:09:02 AM9/8/19
to
Em 03/09/19 15:03, Donal K. Fellows escreveu:
> Updated so that it will display as "\0". Website will be updated the
> next time a build of the docs is pushed.

Thank you, and all

--
{ricardo from kozmate.net}
0 new messages