New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bad documentation about boolean value of strings #2846
Comments
I think we should really keep the current behavior for the I'm in favor of a docfix, not against the idea of a VCL 4.2 where empty strings become falsy as long as we have a vmodless syntax to detect set headers. |
my vote goes to docfix like:
|
IMHO, "String types will evaluate to |false| if they are not set (NULL)"
is better.
Le 28/11/2018 à 10:19, Nils Goroll a écrit :
my vote goes to docfix like:
String types will evaluate to |false| if they are unset (NULL)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2846 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AL_onHn8-CGJxw2euGUKG-ieb7B-cgRjks5uzlUdgaJpZM4Y2ld7>.
--
François Veux - +33633267508
|
There are 2 problems here:
Fixing the former is straight forward. For the latter I believe the diff below should do it but it might be difficult to implement as it might break existing installations:
|
Partially addresses #2846. I've avoided mentioning NULL on purpose as it's not really meaningful nor accessible from VCL. ymmv.
Bugwash conclusion: Docfix. Our treatment of NULL is similar to how Python deals with unset values (None). NULL + NULL returning "" is consistent with our "everything can be turned into a string" rule for VCL. |
Partially addresses #2846. I've avoided mentioning NULL on purpose as it's not really meaningful nor accessible from VCL. ymmv.
Partially addresses varnishcache#2846. I've avoided mentioning NULL on purpose as it's not really meaningful nor accessible from VCL. ymmv.
Currently the documentation states:
To me this means: empty strings (i.e.
""
) are casted tofalse
in boolean context, which is not the actual behaviour.A simple VTC showing this:
I assume this is the intended behaviour, but the documentation is unclear/wrong.
I think that paragraph should be reworded to make clear that any string in a boolean context evaluate to true, even if empty, and that unset values evaluates to false.
I'm not sure if unset value is the right wording, what I mean with that is headers which have never been set or which have been unset.
The text was updated successfully, but these errors were encountered: