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

Re: PATCH: [[ -v varname ]]



On Sep 15, 12:55pm, Vincent Lefevre wrote:
}
} Shouldn't there be 3 states?
} * not declared / not set
} * declared but not set
} * set

There are, but the test in question only distinguishes set/not, there
traditionally has not been a test for whether declared.

The issue at hand (well, one of them) is that zsh treats

    declare var
as 
    declare var=

so you get different results from

    declare var
    [[ -v var ]]

in different shells.



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