aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/ffi.lua.lux
blob: bd38a77b5ec03c638b053d4fa5992790e436d1eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
(.using
 [library
  [lux (.except int char type)
   ["$" documentation (.only documentation:)]
   [data
    ["[0]" text (.only \n)
     ["%" \\format (.only 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.")
  [(is ..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)]
            []))