Timeline for As an argument of a function, when does a variable name need to be quoted?
Current License: CC BY-SA 3.0
3 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 24, 2015 at 5:40 | comment | added | saginaw |
Ok, so when I said that exists() did not evaluate the variable, I was wrong. exists() is no different than strlen() , glob() or any other function. No matter the function, Vim always evaluates the variable before sending the result to the function. Usually this is what you want. But not with exists() , because usually you don't want to check whether the contents of a variable exists but whether the variable itself exists. So, the quotes are here to tell Vim: "don't evaluate the variable, leave it as it is".
|
|
Dec 24, 2015 at 5:02 | vote | accept | saginaw | ||
Dec 24, 2015 at 5:02 | history | answered | muru | CC BY-SA 3.0 |