tarantool / tarantool/doc

Add `:is_new/old()` helpers to tarantool.compat options

Open
#3,574 0 comments 0 reactions 1 assignee View on GitHub

@veod32 is already working on this.

Since Jul 13, 2023.

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

Description

compat.<option_name>.current can be 'new', 'old' or 'default',
thus when it is default there must be an additional check if
compat.<option_name>.default is 'new'. It is handier to have a
helper to deal with that instead of complicated if:

  • check if effective value is 'new' before the patch:
    if compat.<option_name>.current == 'new' or
            (compat.<option_name>.current == 'default' and
             compat.<option_name>.default == 'new') then
        ...
    end
    
  • after the patch:
    if compat.<option_name>:is_new() then
        ...
    end
    

Please update tutorial on using compat, maybe add an example to
Listing options details.

Requested by @Lord-KA in https://github.com/tarantool/tarantool/commit/5f6d367c51f7545a940119e7a393baf982b80f3f.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.