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

Re: One possible answer to typeset vs. unset



On Sat, Nov 28, 2020 at 1:49 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:

> You can see these changes by checking out the "declarednull" branch.

I tried this branch, and I tried to make it pass all the tests. And it
did mostly work, except with tied variables.

I don't know what would be the proper solution for tied variables, but
I used this hack to make the tests pass:

--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -2513,6 +2513,7 @@ typeset_single(char *cname, char *pname, Param
pm, UNUSED(int func),
        }
        tdp->joinchar = joinchar;
        tdp->arrptr = &altpm->u.arr;
+       altpm->node.flags &= ~PM_DECLAREDNULL;

        pm->gsu.s = &tiedarr_gsu;
        pm->u.data = tdp;

-- 
Felipe Contreras




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