On 1/17/25 11:32 PM, Lawrence Velázquez wrote:

I really don't understand how you're reading this text.  Let's start by
actually SHOWING the text in the email, so everyone can follow along.

   1: This expansion modifies the case of alphabetic characters in parameter.

I find Wiley's main thesis -- that this sentence reads as a sort
of topic sentence that implicitly prefixes "alphabetic" to every
subsequent use of "character" -- to be pretty contrived.

The only implicit assumption here is that only alphabetic characters,
regardless of the locale, have upper and lower case variants and
appear in the `upper' and `lower' character classes.

   2: The pattern is expanded to  produce a pattern just as in pathname
      expansion.
   3: Each character in the expanded value of parameter is tested against
      pattern,  and, if  it  matches the pattern, its case is converted.

These can be clarified, since the single- and double-character variants
look at different parts of the expanded value.

   4: The pattern should not attempt to match more than one character.
   5: The ^  operator converts lowercase letters matching pattern to uppercase;
      the , operator converts matching uppercase letters to lowercase.

This general statement covers both the single- and double-character
variants of the expansion.

   6: The  ^^  and ,, expansions convert each matched character in the
      expanded value; the ^ and , expansions match  and  convert  only
      the  first character in the expanded value.

But I do agree that sentences 5 and 6 could be clearer.  If you
already know how things work then it's not hard to understand what
these sentences mean to say, but if you don't then they might make
you scratch your head a bit.

"There are '^' and ',' operators, and also '^' and ',' expansions?

Yes, the expansions are composed of operators. The operators can either
form expansions on their own or be doubled to create different variants.

Consider the parallel with the `#[#]' and `%[%]' pattern removal
expansions.


Are those different?  Is ${foo^x} using the '^' operator or the '^'
expansion?"

The expansion uses the operator. But I'll change the, ah, problematic
terms.

Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to