changes.txt 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. LUABIND 7.1 changes
  2. ===================
  3. * Applied patches from Evan Wies to support lua 5.1
  4. * added a new assignment operator and a special value,
  5. luabind::nil, to set table entries to nil.
  6. LUABIND BETA 7 changes
  7. ======================
  8. We have introduced a change that may break current code,
  9. nothing will break silently however.
  10. The change is that the previous way of writing virtual class
  11. wrappers was to have it contain an object that refered to
  12. the actual lua object. This would cause a dependency cycle
  13. and result in the object never being garbage collected until
  14. the whole lua state was closed. The new way is to use a newly
  15. introduced type called weak_ref, instead of the object.
  16. See docs for more info.
  17. Changes from beta6
  18. ------------------
  19. * renamed get_globals() and get_registry() to globals()
  20. and registry()
  21. * rewrote object and made a few changes:
  22. * moved iterators out of the class and removed
  23. begin/end/raw_begin/raw_end/array_begin/array_end.
  24. See updated docs for how to use the iterators.
  25. * removed array_iterator alltogether
  26. * renamed pushvalue() to push()
  27. * removed set()
  28. * replaced the constructor that creates an object from
  29. a stack value (with better syntax)
  30. * moved out the member functions type(), at() and raw_at()
  31. and made them free functions. (type(), gettable(), settable(),
  32. rawget() and rawset())
  33. * renamed lua_state() to interpreter()
  34. * object now supports nested indexing (with []-operator) as
  35. well as function calls directly on indexed values (i.e.
  36. globals(L)["my_fun"](10)). The indexing has also been made
  37. more efficient through the use of expression templates.
  38. * removed functor (use object with call_function() instead)
  39. * using boost-build, and has better support for building
  40. as a dll. The makefiles still works.
  41. * removed the option LUABIND_DONT_COPY_STRING, this means
  42. that luabind will not provide storage for name strings.
  43. i.e. the strings sent to module, namespace_ and class_
  44. are expected to have global storage (it's no problem as
  45. long as you use string constants)
  46. wrappers
  47. ........
  48. Wrapper classes now have to derive from wrap_base and they don't have
  49. to contain any references to the lua-part (this is done by the base
  50. class now). The overload of call_member() that previuosly took a
  51. weak_ref as first parameter is now a member function of the wrap_base
  52. class and no longer takes the self reference argument. Example:
  53. struct A
  54. {
  55. virtual ~A() {}
  56. virtual std::string f() { return "A:f()"; }
  57. };
  58. struct A_wrap : A, wrap_base
  59. {
  60. virtual std::string f()
  61. {
  62. return call_member<std::string>("f");
  63. }
  64. static std::string default_f(A* p)
  65. {
  66. return p->A::f();
  67. }
  68. };
  69. The changes when registering the virtual functions is that you now
  70. have to register both the virtual function _and_ the default
  71. implementation of the function (for static dispatch). Like this:
  72. module(L)
  73. [
  74. class_<A, A_wrap>("A")
  75. .def(constructor<>())
  76. .def("f", &A::f, &A_wrap::default_f)
  77. ]
  78. If you update your luabind version without changing the way you register
  79. virtual functions, it will still compile, but may give you runtime
  80. errors.
  81. With these changes adopt will work as expected on wrapped types (the
  82. weak reference will be transformed into a strong reference internally).
  83. These changes will also make dynamic function dispatch work from within
  84. lua (and not just from c++ into lua).
  85. policy placeholders
  86. ...................
  87. luabind now handles member functions in a more general way.
  88. The self reference that is passed as first parameter to
  89. member functions is now refered to using the _1 placeholder
  90. (instead of self). This means that the first argument to a
  91. member function is refered to with _2.
  92. additions
  93. .........
  94. * added __newindex metatable entry on c++ classes
  95. * moved more code into cpp-files (hopefully reduces user
  96. compile time slightly)
  97. * the iterators are now true models of ForwardIterator
  98. * error messages when writing non-matching type to a property
  99. or attribute.
  100. * support for inner scopes
  101. * support for nil to holder_type conversion
  102. * wrappers for lua_resume() with the same syntax as
  103. call_function() (resume_function() and resume())
  104. bugfixes
  105. ........
  106. * bugs in the overload resolution could give internal errors
  107. in some cases.
  108. * def_readonly and def_readwrite will now return references
  109. if the type is not a primitive type. This will allow
  110. chained . operators.
  111. * object_cast() of uninitialized objects works
  112. * supports strings with extra nulls in them (not for member
  113. names though)
  114. * fixed reference leakage by reducing the amount of explicit
  115. resource management.
  116. * fixed bug where matchers for getters and setters did not
  117. propagate to derived classes.
  118. * fixed leak when using class wrappers. They had a reference
  119. cycle that wouldn't get collected (until the lua_State was
  120. closed).
  121. * lots of other fixes we can't remember