lua-resty-nettle icon indicating copy to clipboard operation
lua-resty-nettle copied to clipboard

ffi.cdef and ffi.typeof

Open Tieske opened this issue 5 years ago • 2 comments

the cdef statements have a prefix nettle_ to namespace them. The typeof statements do not have those, shouldn't they get them as well, to prevent collisions with other libs?

Tieske avatar Jan 29 '20 16:01 Tieske

@Tieske, does ffi.typeof also cause similar issues? I understand that cdef does as it does not return, but does ffi.typeof also have side effects?

bungle avatar Feb 28 '20 23:02 bungle

they can also only be defined once, or will throw the same error as cdef. That's why they need to be namespaced, so multiple modules will not try to use the same name.

See also: https://github.com/Olivine-Labs/busted/pull/623

Tieske avatar Mar 02 '20 14:03 Tieske