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

Re: "invalid arguments" in cpio completion



On Nov 5,  8:39pm, Daniel Shahaf wrote:
}
} Danek Duvall wrote on Thu, Nov 03, 2016 at 13:32:56 -0700:
} > 
} >     $ local args
} >     $ args+=(a b c)
} >     $ print -l -- "$args[@]"
} > 
} >     a
} >     b
} >     c
} > 
} 
} This behaviour is the same in HEAD.

That's not new behavior; using array-append on a scalar converts the
scalar into a 1-element array before appending to it.

The question is whether an empty scalar should be converted into a
1-element array or an empty array.  This goes back to the fact that
in zsh without posixbuiltins, a declared variable is implicitly set,
and therefore its value is the empty string.

BTW, in the current HEAD zsh *with* posixbuiltins, attempting to
assign an array to an exported scalar will result in an error message
*but also* causes the scalar to become set (to empty).  I'm not sure
what if anything posix compatibility would say about this.



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