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

Re: More warn_create_global warnings



[still on my phone with limited bandwidth...] 

> Do I have to mark those local before using back tracking?

Yes, if you don't want a warning. 

>Or could those 
> maybe be created in local scope unless they already exist? 

We don't know what scope you need them in.  You might have a utility
function in a script that needs to pass them back. It would be extremely
annoying to have to unpick this when the lack of a local wasn't actually
a problem.

Automatically set variables like these are particularly susceptible to causing
problems if you don't get the local in the right place.  That's because
they can be used at multiple levels in various different ways.

By contrast, variable names you pick yourself are less likely to cause
problems.

So if you don't want a warning here, it could be a sign you don’t really
need the warnings at all.

pws


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