Closed leostera closed 6 months ago
@leostera I have been looking at this bug and noticed a few things. I am also very new to OCaml so apologies if I am off on any of it.
cfg_lang_test.ml
file is using an extra set of parens as compared to what is in the github issue above which is why that unit tests passes but the actual test in the module fails
[@config (not(made_up = true))]
Eval.eval
function. Meaning [@config (not((made_up = true)))]
-> not (made_up = true)
. I would have expected it to be not ((made_up = false))
. My limited knowledge leaves me feeling like this is something more "core". Maybe perhaps because not
is part of Stdlib?I have attempted to fix this with the PR: https://github.com/ocaml-sys/config.ml/pull/7
This is fixed thanks to @gpetiot in #11 and added test for it in #12
Thanks a million @gpetiot and @KFoxder! Closing this now :)
It looks like annotating
[@config (not(a = 1))]
actually breaks at evaluation time with:And using a variable to test for it being unset like
[@config (not(a))]
, failed with:The expected behavior is that both of these parse correctly and evaluate as follows:
not(expr)
is equals to false if the expression is true, or true if it is falsenot(varName)
is equals to true if the varName is not defined in the environment or has no value, or false if varName has a value