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

Re: A way to untie -T vars?



On Tue, Jan 24, 2023 at 6:45 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> I've reached the conclusion that "local" makes no difference here.

I actually knew that! There is no way to remove a parameter from a
scope. Once a name is added to a scope, it stays there forever (until
the whole scope dies) and a lookup for the name will always stop on
this scope.

> Attached this time because I'm sure gmail would maim it.  This has
> been tested with convoluted cases, but not with simple ones, so it may
> still need refinement.

LGTM. I'm a bit paranoid about matching words such as "tied" without
anchors. If in the future we get type keywords that have these as
substrings ("guarantied"), this code will break.

The fact that this function has to fork diminishes its applicability greatly.

Up until this thread I thought that `bindkey` was the only builtin
that printed information that is otherwise unobtainable: retrieving
bindings requires forking or file I/O. Now `typeset +m` can be added
to the list: retrieving the type of a parameter also requires forking
or file I/O.

Roman.




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