lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Op Thu, 14 Jul 2022 22:47:56 +0200 schreef Jonathan Goble <jcgoble3@gmail.com>:


To solve the boolean issue, I would suggest adding a method to `perms`
objects. Example:

if perms.owner_write:in(variable_with_permissions) then
    -- ...
end

...except `in` is a reserved keyword and I don't know what would best
replace it. (Naming things is hard!)


Something like that crossed my mind and use functions like 'test', 'set' and 'clear' instead of binary operators.
But I had hard time to make up a nice API to construct a new value from multiple flags.

The advantage of functions over the binary operators is that library may gain compatibility for Lua 5.2 and 5.1

-- Jasper