ZyX wrote:

> If I do
> 
>     vim -u NONE -c 'unlet $PATH'
> 
> I get “E488: Trailing characters” error.
> 
> That means that there is no way to get rid of environment variable
> after it was set which may be essential if tools using variables check
> for their existence, not for their contents (e.g. in tcsh scripts
> checking for emptyness and for existence are different constructs and
> they are rarely checked both (and non-existent variables expand to
> errors, not to empty values), it is also not uncommon to write “if
> 'VARNAME' in os.environ:” or use EAFP principle in python in which
> cases empty string is treated just like any other value).

Historically environment variables cannot be deleted, only made empty.
It's not a good idea to check for existence, check for it being
non-empty instead.

Note that Vim will consider a non-existing environment variable to be
empty, it doesn't give an error for ":let s = $ASDFASDF".

-- 
hundred-and-one symptoms of being an internet addict:
248. You sign your letters with your e-mail address instead of your name.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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.

Raspunde prin e-mail lui