ffi: canonical static access ffi::load (module namespace)
- '::' accesses a static/class member (here the module namespace ffi), '.'/':' sends to an instance. ffi is a module, so ffi::load is the canonical form; the native now accepts the receiver passed by '::'. - example, tests and README use ffi::load; '.load' still works (compat). - 69/69 tests
This commit is contained in:
1 parent
05f31aed68
commit
4dae4ee1cd
4 files changed
+28
-10
No files matched your search
+3
-3
@@ -3,11 +3,11 @@
|
||||
-- Deterministic output (no getpid): loads, symbol binding, signatures,
|
||||
-- return conversions, and the nil-on-error contract.
|
||||
|
||||
local m = ffi.load("libm.so.6")
|
||||
local c = ffi.load("libc.so.6")
|
||||
local m = ffi::load("libm.so.6")
|
||||
local c = ffi::load("libc.so.6")
|
||||
|
||||
-- load failure / bad library -> nil
|
||||
local bad = ffi.load("no_such_library_xyz.so.999")
|
||||
local bad = ffi::load("no_such_library_xyz.so.999")
|
||||
print("bad load nil:", bad == nil)
|
||||
print("bad load type:", type(bad))
|
||||
|
||||
|
||||
Reference in new issue
Block a user