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

Re: function variables question



On Jun 7,  5:33pm, Timothy J Luoma wrote:
} Subject: function variables question
}
} I tend to use the same variable names in a lot of functions ...
} 
} Should I be doing 'unset name ; unset short ; unset i' at the end of them,  

No, you should be declaring

	local name short i

at the beginning of each function, so that those variables automatically
go back to their previous values (or to unset if they weren't set before)
at the end of the function.

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



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