Subject: Re: ZSH_SCRIPT
From: Martijn Dekker <[email-masked]>
To: [email-masked]
Date: Wed, 02 Mar 2016 20:34:59 +0100
List-Id: Zsh Workers List <zsh-workers.zsh.org>

Peter Stephenson schreef op 01-03-16 om 16:07:
> On Tue, 1 Mar 2016 09:39:19 -0500
> Greg Klanderman <[email-masked]> wrote:
>> Should we explicitly document that ZSH_SCRIPT is empty rather than
>> unset when not invoked as a script?
> 
> That would probably be sensible.

Is there a particular reason why it should be empty rather than unset?
Unset seems more logical; if we're not running a script, the script name
is not the empty string but it doesn't exist. This would also make it
possible to do
	[[ -v ZSH_SCRIPT ]]
to check if you're in a script.

- M.