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

Re: real time alias?



hello,

> $ function test1 ()
> {
>     test2 # unchanged since last sourcing of this function.
>     setopt GRAB_ALIASES_AGAIN test2
>     test2 # Up-to-date.
>     test3
> }

you need to stack the alias definitions foreach aliases.
what you need is an associative array of arrays ... and
this is one of the boring limit of zsh (AFAIK): nested
structures needs files.

the best i have is: you cannot localize an alias but you can localize an
array

    alias my@='typeset -a'

    my@ test2=( echo this is it )
    () {
        my@ test2=( echo this is it )
        $test2
    }
    $test2


regards
marc













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