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

The emulation rabbit-hole RE typeset/unset



On Fri, Nov 27, 2020 at 4:00 PM Felipe Contreras
<felipe.contreras@xxxxxxxxx> wrote:
>
> This is a bit tautological, because if the variable is unset, it can't
> be anything else but a string: param_is_unset(p) ->
> param_type_is_string(p).

This is manifestly not true in ksh and bash, because:

[[ ${foo-nil} = nil ]] implies foo is unset
{ typeset -i foo } declares foo is an integer, not a string
function ff { typeset -i foo; echo ${foo-nil}; } outputs nil

Do we care whether zsh emulates this?




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