tarantool / tarantool/doc

lua: new method table.equals

Open
#2,288 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

2.10 feature server
Dominant language
CSS
Stars
15
Forks
49
Avg merge
1d 13h
Merged PRs (30d)
3

Description

Product: Tarantool
Since: 2.10.0-beta1
Root document: https://www.tarantool.io/en/doc/latest/reference/reference_lua/table/
SME: @ sergepetrenko

Details

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)
Requested by @sergepetrenko in https://github.com/tarantool/tarantool/commit/0afe1f78a51990d7849a11339fe9c5af06165bd4.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the table reference document at the linked root document and locate the existing table methods. Add documentation for table.equals, including the deep-comparison example and the __eq metamethod behavior described in the issue. Done means the new method is discoverable and its comparison semantics are clear in the reference.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.