2018-05-07 23:32 GMT+03:00 Ni Va <[email protected]>:
> Le lundi 7 mai 2018 22:17:06 UTC+2, Ni Va a écrit :
>> Le lundi 7 mai 2018 21:55:57 UTC+2, Bram Moolenaar a écrit :
>> > Ken Takata wrote:
>> >
>> >
>> >
>> > > This might be used for a workaround for the following todo item:
>> >
>> > >
>> >
>> > > > Can't recognize the $ProgramFiles(x86) environment variable.  
>> > > > Recognize it
>> >
>> > > > specifically?  First try with the parens, then without.
>> >
>> >
>> >
>> > You mean to pass the name to the getenv() function?
>> >
>> > It's a very specific usage, but I suppose it's better than trying to
>> >
>> > parse the name when used in $VAR form.
>> >
>> >
>> >
>> > We could still use environ() to get the dictionary and getenv(name) to
>> >
>> > get the value of one.  Main reason is that the type of the return value
>> >
>> > differs.
>> >
>> >
>> >
>> > --
>> >
>> >     f y cn rd ths thn y cn hv grt jb n cmptr prgrmmng
>> >
>> >
>> >
>> >  /// 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 are receiving this because you are subscribed to this thread.
>> > Reply to this email directly, view it on GitHub
>
> no need redundant getenv func please with exists($env
> thank you
>
> https://realpython.com/vim-and-python-a-match-made-in-heaven/

I would suggest to use curly-braces-name for various strange
environment variables. And maybe just `$` to get a dictionary if
needed: this would be consistent with `g:` returning dictionary I
think, though with a bunch of differences (I do not think that updates
to dictionary will update environment or that updating environment
will update dictionary, both is the case for `g:`).

As for curly-braces-name: the following example should define bash
function `f` which only returns with exit code 2

    let $BASH_FUNC_f{'%%'} = "() {\nreturn 2\n}"

should be usable for getting environment as well.

Choosed this specific example to remind that weird environment varible
names *are* actually used and not only on Windows.

>
> --
> --
> 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/d/optout.

-- 
-- 
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/d/optout.

Raspunde prin e-mail lui