[Rpm-maint] [rpm-software-management/rpm] RFE: pass parametric macro options and arguments to Lua natively (#1092)
nim-nim
notifications at github.com
Fri Oct 9 08:32:55 UTC 2020
> Oh, looking closer:
>
> > @nim-nim wrote
> > [...]
> > exist because nil is not the same as false or empty
>
> Yes, nil is not same as empty. It however very explicitly is same as false, quoting https://www.lua.org/manual/5.4/manual.html#2.1:
````(lua)
> if (nil == false) then print("nil is the same thing as false") else print("nil and false are different") end
nil and false are different
````
As this trivial example shows they are most definitely not the same at the language level, and if you expect them to you **will** get unexpected comparison and conditional behaviors. (other things that will fail unexpectedly is transformation to string values, which is where the empty string comes into play).
nil means unset. false means explicitly set to a specific false value. empty string means empty string. Clean programming languages like lua are very careful to distinguish between those. rpm macro language is not careful, that’s why the first google hits on rpm conditionals/comparisons is "it does not work as you expect to", why no one writes complex logic rpm macro language, and why redhat-rpm-config maintainers suspect any new macro submission to contain dangerous quirks.
So get down your high horse and please implement things cleanly. And if you insist, please do implement clean true and false keywords in the rpm macro language to clean up the legacy mess there too.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1092#issuecomment-706048624
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20201009/d751d3f5/attachment.html>
More information about the Rpm-maint
mailing list