Zsh Mailing List Archive
Messages sorted by:
Re: Emulation and NUMERIC_GLOB_SORT
- X-seq: zsh-workers 8621
- From: Zefram <zefram@xxxxxxxx>
- To: schaefer@xxxxxxxxxxxxxxxxxxxxxxx (Bart Schaefer)
- Subject: Re: Emulation and NUMERIC_GLOB_SORT
- Date: Thu, 11 Nov 1999 11:01:46 +0000 (GMT)
- Cc: zsh-workers@xxxxxxxxxxxxxx
- In-reply-to: <991111102514.ZM19137@xxxxxxxxxxxxxxxxxxxxxxx> from Bart Schaefer at "Nov 11, 1999 10:25:14 am"
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Bart Schaefer wrote:
>However, now that I think of it, globbing order is already going to be
>altered by LC_COLLATE, so scripts that rely on it are out of luck in
>the first place.
Erk. I hope that's not POSIX. I think we should probably remove that,
just as we removed it from character ranges, and for exactly the same
reason that we want NUMERIC_GLOB_SORT to be reset by emulation.
Fundamentally, I view globbing as a programming feature, which should
be utterly unaffected by locale. Same for string comparisons in [].
I think we do want a locale-dependent string comparison operation, but
its use is very much the exception, not the rule. Pattern matching and
string comparisons are used on all sorts of strings, and only very rarely
on natural-language text.
Exactly the same argument applies to numeric syntax; the use of "." as
the decimal point is part of the language syntax, and should not be
locale-dependent. A builtin that could take a number in standard syntax
and render it in locale-dependent syntax would be nice.
If use of LC_COLLATE in globbing is POSIX (and maybe even if it's not),
we could reasonably make that another option, which would itself be
affected by emulate (and I'd argue that it should be off by default in
all current emulation modes).
 That reminds me, one of the things I never got round to implementing
as a builtin was the POSIX "printf" utility. The advantage of having
it as a builtin is that we could then use the same code for a "sprintf"
builtin, which would put the result into a shell variable instead of
sending it to standard output, which is a feature I often miss.
Messages sorted by: