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

Re: More rabbit-holes with unset variables



On Thu, Nov 26, 2020 at 5:30 AM Roman Perepelitsa
<roman.perepelitsa@xxxxxxxxx> wrote:
>
> On Thu, Nov 26, 2020 at 12:22 PM Oliver Kiddle <opk@xxxxxxx> wrote:
> >
> > But if we decide to "fix" it for zsh, I don't think it'll break too much.
>
> What kind of change do you envision? Will it change the output of this command?
>
>   zsh -c 'f() { local -i x; echo $x; }; f'
>
> If yes, it'll likely break a lot of code (it'll surely break my code).
> If no, then the behavior of the following command should also stay
> unchanged for consistency:
>
>   zsh -c 'f() { local x; echo ${x-y}; }; f'

I disagree. The first one is an orange, the second is an apple.

In my opinion it's perfectly reasonable to return 0 in the first, and
nil in the second.

-- 
Felipe Contreras




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