Skip to content
Snippets Groups Projects
  • Serge Petrenko's avatar
    0afe1f78
    lua: introduce table.equals method · 0afe1f78
    Serge Petrenko authored
    Introduce table.equals for comparing tables.
    The method respects __eq metamethod, if provided.
    
    Needed-for #5894
    
    @TarantoolBot document
    Title: lua: new method table.equals
    
    Document the new lua method table.equals
    It compares two tables deeply. For example:
    ```
    tarantool> t1 = {a=3}
    ---
    ...
    
    tarantool> t2 = {a=3}
    ---
    ...
    
    tarantool> t1 == t2
    ---
    - false
    ...
    
    tarantool> table.equals(t1, t2)
    ---
    - true
    ...
    ```
    The method respects the __eq metamethod. When both tables being compared
    have the same __eq metamethod, it's used for comparison (just like this
    is done in Lua 5.1)
    0afe1f78
    History
    lua: introduce table.equals method
    Serge Petrenko authored
    Introduce table.equals for comparing tables.
    The method respects __eq metamethod, if provided.
    
    Needed-for #5894
    
    @TarantoolBot document
    Title: lua: new method table.equals
    
    Document the new lua method table.equals
    It compares two tables deeply. For example:
    ```
    tarantool> t1 = {a=3}
    ---
    ...
    
    tarantool> t2 = {a=3}
    ---
    ...
    
    tarantool> t1 == t2
    ---
    - false
    ...
    
    tarantool> table.equals(t1, t2)
    ---
    - true
    ...
    ```
    The method respects the __eq metamethod. When both tables being compared
    have the same __eq metamethod, it's used for comparison (just like this
    is done in Lua 5.1)