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

Re: Stuff I don't understand



On Apr 9, 11:56am, Sven Wischnowsky wrote:
}
} Will Sargent wrote:
} 
} > I don't quite understand compset.  Or local -- and what
} > curcontext="$curcontext" means.  Or typeset.
} 
} Can't help you with all of this... ;-)

Yeah, but you can help with a little of it.  In particular, `local' is
a synonym for `typeset', `typeset' (or `local') inside a function mean
to create a new variable in the scope of that function, and specifically

    local curcontext="$curcontext"

means to copy the value of the variable from the surrounding scope as
the value of the new variable in function scope, because "$curcontext"
is expanded before the `local' command is executed.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



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