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

Re: Builtin strftime and TZ assignments



On Sat, 21 Feb 2015 16:39:22 -0800
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> Yes; I assumed incorrectly that passing PM_LOCAL in the flags would cause
> createparam() to assign pm->level = locallevel, but obviously I should
> have explicitly checked that.  (Why does it not?)

Up to now the assignment of local level has been associated with the
"local" command etc., which is what the user sees when declaring the
parameter local, rather than the internal flag.  To decide which is
better you'd have to survey all the uses and see which way gave you the
best match.

I think the PM_LOCAL flag (or maybe some equivalent predecessor) came
about because we were caught between the fact that the "typeset" family
usually made things local and the fact that "export" traditionally
didn't, so we needed an extra way of signalling the difference.  Then
along came the -g option and we needed a way of signalling that, too.
The level was the primary way of signalling whether a parameter needed
removing at the end of the scope and the flag was an additional
convenience.

All this logic got piled into bin_typeset() rather than the core
parameter code, and as I was saying a couple of weeks ago the split
doesn't work very well for many of the internal uses of parameter logic.
Logically, I would guess you don't actually need both: level 0 should
mean global, but the level doesn't appear in the interface to the core
parameter code.

pws



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