diff options
Diffstat (limited to 'stdlib/source/documentation/lux/ffi.lua.lux')
-rw-r--r-- | stdlib/source/documentation/lux/ffi.lua.lux | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/stdlib/source/documentation/lux/ffi.lua.lux b/stdlib/source/documentation/lux/ffi.lua.lux new file mode 100644 index 000000000..79d6f03ac --- /dev/null +++ b/stdlib/source/documentation/lux/ffi.lua.lux @@ -0,0 +1,38 @@ +(.using + [library + [lux {"-" int char type :as} + ["$" documentation {"+" documentation:}] + [data + ["[0]" text {"+" \n} + ["%" format {"+" format}]]] + [macro + ["[0]" template]]]] + [\\library + ["[0]" /]]) + +(documentation: /.import: + "Easily import types, methods, functions and constants." + [(import: (os/getenv [..String] "io" "?" ..String))]) + +(documentation: /.closure + (format "Allows defining closures/anonymous-functions in the form that Lua expects." + \n "This is useful for adapting Lux functions for usage by Lua code.") + [(: ..Function + (closure [left right] + (do_something (:as Foo left) (:as Bar right))))]) + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [..import: + ..closure + ($.default (/.Object brand)) + ($.default /.Nil) + ($.default /.Function) + ($.default /.Table) + ($.default /.Boolean) + ($.default /.Integer) + ($.default /.Float) + ($.default /.String)] + [])) |