Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: function variables question
- X-seq: zsh-users 1581
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- To: Timothy J Luoma <luomat+Lists/Zsh/users@xxxxxxxxxxxxxxx>, zsh-users@xxxxxxxxxxxxxxx
- Subject: Re: function variables question
- Date: Sun, 7 Jun 1998 17:05:11 -0700
- In-reply-to: <199806072133.RAA00849@xxxxxxxxxxxxxxx>
- References: <199806072133.RAA00849@xxxxxxxxxxxxxxx>
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