Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: nested ${(P)} (formerly SHWORDSPLIT and leading spaces)



On Nov 14,  9:45am, Peter Stephenson wrote:
}
} Sorry, I obviously didn't explain the change properly. The new
} behaviour is both expected and necessary to have the clean separation
} between levels of nesting: if a (P) occurs inside multiple braces,
} the immediately surrounding level deals with the parameter name,
} and the outer level deals with the value.

I think it's more subtle than that.  It occurs only when:

    1. there is an outer ${...} around the ${(P)...} expansion
    2. the (P) is combined with one of (l), (r), or (j).

If there's only one level, ${(Pr.N.)...} et al. work as expected.

So I suspect that the specific code path(s) used by padding and joining
are failing to turn off the flag bit that indicates the value has been
fetched already, causing the outer ${ } to unnecessarily attempt again
to fetch the value.  Or something like that.

-- 
Barton E. Schaefer



Messages sorted by: Reverse Date, Date, Thread, Author