On Wed, 25 Jun 2025 14:00:11 -0400 Greg Wooledge wrote:
> Both of those are valid syntax, and they have *slightly* different
meanings.

True, both forms are syntactically valid.

It could be, at some earlier draft, that the variation in syntax was placed
there as an exercise for the reader, given how the paragraph immediately
preceding this example is the one which explains, "Omitting the colon
results in a test only for a parameter that is unset."

On the other hand, the example in question is at the beginning of the full
list of ~13 P.E.'s. These detailed explanations are listed consecutively
without any intervening paragraphs. Omitting an initial ':' would be
meaningful for just the first x4 P.E.'s.

I don't see any other written instances of omitting a ':' amongst the
examples in these x4 descriptions.

Whether the existing omission was intentional or no, I think it would be
helpful for the reader to point up how that one line of code serves as an
example of omitting a ':', especially since there aren't any other such
examples.

In the same section at the 5th P.E. on the next page, in my opinion for the
sake of thoroughness and consistency, the addition of one word would be
beneficial: "initial," "first," 'non-following,' or something.

"Note that a negative offset must be separated from the [non-following]
colon by at least one space to avoid being confused with the ‘:-’
expansion,' since a negative offset can exist immediately beside a
subsequent colon.

Wiley

Reply via email to