> It appears that we have two conflicting requirements here when only one
> can be supported.
No.
> On the one hand we have ViM's current behaviour as pointed out by Bram:
>
> On 03/02/14 02:54, Bram Moolenaar wrote:
> >
> > Historically environment variables cannot be deleted, only made empty.
> > ...
> > Note that Vim will consider a non-existing environment variable to be
> > empty, it doesn't give an error for ":let s = $ASDFASDF".
>
> While on the other we have the desire to be able to remove an environment
> variable from the environment of the currently running ViM process, making
> the ViM variable equivalent of that environment variable "non-existent".
No. Shells have `unset` for years, it does not make them unable to treat
unexistent variables as empty except for the certain cases.
> The fact of the matter is that ViM's current behaviour, in considering a
> "non-existent" environment variable as "defined but empty", means that
> even if an "unlet" command on an environment variable were to exist it
> still wouldn't give the desired effect, as any subsequent test on the unlet
> variable would just yield an empty value, not "variable undefined" (which
> is what is being called for).
I did not suggest altering this behavior.
> Thus, as well as adding "unlet", as you would also have to modify the
> fundamental way in which ViM environment variable handling works, this
> kind of change could seriously upset all existing scripts and plug-ins.
No. The only thing which is supposed to be altered is `:unlet $VAR` removing
variable from global.
> However, in addition to the "unlet" command, if it were possible just to
> modify the "exists()" function so that "exists($XXX)" returns Zero if XXX
> is physically not in the environment and One if XXX is physically there,
> regardless of its value, then unletting an environment variable and then
> checking for its existence with "exists($XXX)" would solve the problem
> (currently, "exists($XXX)" is the same as testing if $XXX is empty).
Did you read me? My reply to Bram at least. It *already* works this way.
`exist('$EMPTY')` will return 1 as far as value is in environment, regardless
of whether or not is empty.
> Furthermore, if only "exists()" is changed, while the impact to scripts
> would still exist. the current behaviour of returning an empty string
> value when accessing non-existent environment variables would be retained.
> This would definitely be the lesser of two evils with regards to backward
> compatibility.
`exists()` does not have to be changed. Neither does result of accessing
non-existent variables. I am only talking about `:unlet`.
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.