[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Exposing emum flags from the C-API
- From: "Jasper Klein" <jasper@...>
- Date: Fri, 15 Jul 2022 19:35:47 +0200
Op Thu, 14 Jul 2022 22:47:56 +0200 schreef Jonathan Goble <email@example.com>:
To solve the boolean issue, I would suggest adding a method to `perms`
if perms.owner_write:in(variable_with_permissions) then
...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