10 #include <luabind/luabind.hpp>
12 void bind_cln(lua_State
* L
)
14 using namespace luabind
;
22 .def(constructor
<const cl_I
&>())
23 .def(constructor
<float>())
24 .def(constructor
<const char*>())
25 .def(tostring(const_self
))
27 .def(const_self
+ const_self
)
28 .def(const_self
- const_self
)
29 .def(const_self
* const_self
)
30 .def(const_self
/ const_self
)
31 .def(const_self
<= const_self
)
32 .def(const_self
< const_self
)
33 .def(const_self
== const_self
)
34 .def(other
<int>() + const_self
)
35 .def(other
<int>() - const_self
)
36 .def(other
<int>() * const_self
)
37 .def(other
<int>() / const_self
)
38 .def(other
<int>() <= const_self
)
39 .def(other
<int>() < const_self
)
40 .def(const_self
+ other
<int>())
41 .def(const_self
- other
<int>())
42 .def(const_self
* other
<int>())
43 .def(const_self
/ other
<int>())
44 .def(const_self
<= other
<int>())
45 .def(const_self
< other
<int>())
49 class_
<cl_RA
, cl_R
>("cl_RA")
51 .def(constructor
<const cl_I
&>())
52 .def(constructor
<int>())
53 .def(constructor
<const char*>())
54 .def(tostring(const_self
))
56 .def(const_self
+ const_self
)
57 .def(const_self
- const_self
)
58 .def(const_self
* const_self
)
59 .def(const_self
/ const_self
)
60 .def(const_self
<= const_self
)
61 .def(const_self
< const_self
)
62 .def(const_self
== const_self
)
63 .def(other
<int>() + const_self
)
64 .def(other
<int>() - const_self
)
65 .def(other
<int>() * const_self
)
66 .def(other
<int>() / const_self
)
67 .def(other
<int>() <= const_self
)
68 .def(other
<int>() < const_self
)
69 .def(const_self
+ other
<int>())
70 .def(const_self
- other
<int>())
71 .def(const_self
* other
<int>())
72 .def(const_self
/ other
<int>())
73 .def(const_self
<= other
<int>())
74 .def(const_self
< other
<int>())
78 class_
<cl_I
, cl_RA
>("cl_I")
80 .def(constructor
<const cl_I
&>())
81 .def(constructor
<int>())
82 .def(constructor
<const char*>())
83 .def(tostring(const_self
))
85 .def(const_self
+ const_self
)
86 .def(const_self
- const_self
)
87 .def(const_self
* const_self
)
88 .def(const_self
<= const_self
)
89 .def(const_self
< const_self
)
90 .def(const_self
== const_self
)
91 .def(other
<int>() + const_self
)
92 .def(other
<int>() - const_self
)
93 .def(other
<int>() * const_self
)
94 .def(other
<int>() <= const_self
)
95 .def(other
<int>() < const_self
)
96 .def(const_self
+ other
<int>())
97 .def(const_self
- other
<int>())
98 .def(const_self
* other
<int>())
99 .def(const_self
<= other
<int>())
100 .def(const_self
< other
<int>())
103 def("factorial", &cln::factorial
),
104 def("sqrt", (const cl_R(*)(const cl_R
&))&cln::sqrt
)
110 lua_State
* L
= lua_open();
117 lua_dofile(L
, "cln_test.lua");