From f8d896f2a751887a2433bd8e342c16ef0abff8fc Mon Sep 17 00:00:00 2001 From: Stephen Lane-Walsh Date: Thu, 20 Jul 2017 15:31:31 -0400 Subject: [PATCH] Corrected semi-colon ';' to colon ':' in usertype documentation --- docs/source/usertypes.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/usertypes.rst b/docs/source/usertypes.rst index 19142b39..fe98a9cd 100644 --- a/docs/source/usertypes.rst +++ b/docs/source/usertypes.rst @@ -1,7 +1,7 @@ usertypes ========= -Perhaps the most powerful feature of sol2, ``usertypes`` are the way sol2 and C++ communicate your classes to the Lua runtime and bind things between both tables and to specific blocks of C++ memory, allowing you to treat Lua userdata and other things like classes. +Perhaps the most powerful feature of sol2, ``usertypes`` are the way sol2 and C++ communicate your classes to the Lua runtime and bind things between both tables and to specific blocks of C++ memory, allowing you to treat Lua userdata and other things like classes. To learn more about usertypes, visit: @@ -13,11 +13,11 @@ To learn more about usertypes, visit: The examples folder also has a number of really great examples for you to see. There are also some notes about guarantees you can find about usertypes, and their associated userdata, below: * All usertypes are runtime extensible in both `Lua`_ and `C++`_ -* Please note that the semi-colon is necessary to "automatically" pass the ``this``/``self`` argument to Lua methods +* Please note that the colon is necessary to "automatically" pass the ``this``/``self`` argument to Lua methods - ``obj:method_name()`` is how you call "member" methods in Lua - It is purely syntactic sugar that passes the object name as the first argument to the ``method_name`` function - ``my_obj:foo(bar, baz)`` is the same as ``my_obj.foo(my_obj, bar, baz)`` - - **Please note** that one uses a semi-colon, and the other uses a dot, and forgetting to do this properly will crash your code + - **Please note** that one uses a colon, and the other uses a dot, and forgetting to do this properly will crash your code - There are safety defines outlined in the :ref:`safety page here` * You can push types classified as userdata before you register a usertype. - You can register a usertype with the Lua runtime at any time sol2 @@ -42,4 +42,4 @@ The examples folder also has a number of really great examples for you to see. T .. _here, that uses a few tricks: https://github.com/ThePhD/sol2/blob/develop/examples/usertype_bitfields.cpp .. _Lua: https://github.com/ThePhD/sol2/blob/develop/examples/usertype_advanced.cpp#L81 -.. _C++: https://github.com/ThePhD/sol2/blob/develop/examples/usertype_simple.cpp#L51 \ No newline at end of file +.. _C++: https://github.com/ThePhD/sol2/blob/develop/examples/usertype_simple.cpp#L51