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

Re: [PATCH 2/5] _hg: declare appropriate local parameters for ->string form



Peter Stephenson wrote on Mon, 06 Aug 2018 10:29 +0100:
> On Mon, 6 Aug 2018 09:20:32 +0000
> Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
> > To -workers, couldn't we write a wrapper such as the following:
> > 
> >     _added_matches_p() {
> >         local nmatches=$compstate[nmatches]
> >         "$@"
> >         (( nmatches < $compstate[nmatches] ))
> >     }
> > 
> > to reduce the need to manage $ret in every single layer of the
> > callstack?
> 
> Are you suggesting avoiding looking at the return value, but looking at
> what its effect would have been at the point where you would have looked
> it?

Yes.



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