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

Re: Creating A Clean Environment For Autoloaded Functions



On Sun, Dec 30, 2012 at 11:20:44AM -0800, Bart Schaefer wrote:
>     {
>       zmodload zsh/parameter
>       local -a existing_modules
>       existing_modules=( ${(k)modules[(R)loaded]} ) 
> 
>       : do whatever zmodloads you want ...
> 
>     } always {
>       # Requires zsh 5.0, otherwise you need a loop
>       zmodload -u ${(k)modules[(R)loaded]:|existing_modules}

How could we know that, the "(k)" will be run before ":|" here, please?
Because "k" will be applied with the subscripting, so it will be before
the ":|" ?

Thanks.

>     }



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