Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix text formatting and code examples according to Lua style guide #2249

Merged
merged 6 commits into from
Oct 6, 2021

Conversation

NickVolynkin
Copy link
Contributor

Resolve #2236

@github-actions github-actions bot temporarily deployed to translation-gh-2236-lua-style July 21, 2021 07:45 Inactive
@github-actions github-actions bot temporarily deployed to branch-gh-2236-lua-style July 21, 2021 07:45 Inactive
@github-actions github-actions bot temporarily deployed to translation-gh-2236-lua-style September 25, 2021 15:00 Inactive
@github-actions github-actions bot temporarily deployed to branch-gh-2236-lua-style September 25, 2021 15:00 Inactive
@ainoneko ainoneko self-assigned this Sep 29, 2021
@github-actions github-actions bot temporarily deployed to translation-gh-2236-lua-style October 1, 2021 04:46 Inactive
@github-actions github-actions bot temporarily deployed to branch-gh-2236-lua-style October 1, 2021 04:47 Inactive
@patiencedaur patiencedaur self-assigned this Oct 1, 2021
@github-actions github-actions bot temporarily deployed to translation-gh-2236-lua-style October 4, 2021 09:03 Inactive
@github-actions github-actions bot temporarily deployed to translation-gh-2236-lua-style October 4, 2021 09:19 Inactive
@github-actions github-actions bot temporarily deployed to branch-gh-2236-lua-style October 4, 2021 09:19 Inactive
the main key_def_object, then all the fields of other_key_def_object which
are not in the main key_def_object.
Combine the main ``key_def_object`` with ``other_key_def_object``.
The return value is a new ``key_def_object`` containing all the fields of
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Totktonada
The names of the new and old objects are the same now, so it's a little confusing. The function returns a totally new object, not the altered old one—is that correct?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reply from @ Totktonada:
Да, :merge() возвращает новый объект.

@@ -191,7 +192,7 @@ to extract or compare the index key values.

.. code-block:: none

-- This will return a key definition with fieldno=3 and fieldno=1.
-- This will return a key definition with fieldno = 3 and fieldno = 1.
Copy link
Contributor

@patiencedaur patiencedaur Oct 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Totktonada
"возвращает определение ключа по полям fieldno = 3 и fieldno = 1"? "для полей"? "содержащее поля"?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explanation from @ Totktonada:

Давай я в целом про таплы, ключи и определения ключей напишу — должно стать понятней.

Тапл — это массив, строка в спейсе (можно сказать, в таблице, но таплы могут различаться по длине). Возьмем для примера [1, 'foo', 'bar'].

Определение ключа (key definition, key def) — это информация в духе «третье и первое поля тапла» (плюс еще типы в этих полях и еще разные детали). Порядок имеет значение.

Ключ или значение ключа — это в данном случае, собственно, массив из значения третьего и первого поля. Для тапла [1, 'foo', 'bar'] это будет ['bar', 1].

Illustration

Comment on lines 21 to 22
There must be at least one part and it
must have at least fieldno and type.
must have at least ``fieldno`` and ``type``.
Copy link
Contributor

@patiencedaur patiencedaur Oct 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Totktonada
Must all parts have the fieldno and type attributes? Or can there be only one part with those attributes, while the other parts don't have those attributes? It is not quite clear.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All parts must have fieldno or field attribute (see #962). All parts must have type attribute. Other attributes are optional. The parts array should have at least one item.

@github-actions github-actions bot temporarily deployed to branch-gh-2236-lua-style October 5, 2021 12:15 Inactive
@github-actions github-actions bot temporarily deployed to translation-gh-2236-lua-style October 5, 2021 12:17 Inactive
@patiencedaur
Copy link
Contributor

patiencedaur commented Oct 5, 2021

@Totktonada

Lines 11–12:
The definition is usually used in conjunction with an index definition
to extract or compare the index key values.

What does "index key values" mean here? How are index and key related in this context?
I understand that an index is a data structure, while a key is an array.

@Totktonada
Copy link
Member

Say, we have a space (named 'users'):

id email name
1 foo@bar.baz Ivan Petrov
2 baz@foo.bar Petr Ivanov

With primary index by the 'id' field and secondary index by 'email' and 'name' fields.

A get request by the primary index could be box.space.users:get({1}) — here {1} is the key that corresponds the 'id field. If we want to perform a get request using the secondary index, we should pass a key that corresponds its fields: box.space.users:get({'foo@bar.baz', 'Ivan Petrov'}).

So index is usually constructed on a subset of tuple's fields and phrases like 'index key' mean a key that is suitable to perfrom a request using this index.

@github-actions github-actions bot temporarily deployed to translation-gh-2236-lua-style October 5, 2021 15:57 Inactive
@github-actions github-actions bot temporarily deployed to branch-gh-2236-lua-style October 5, 2021 15:59 Inactive
@github-actions github-actions bot temporarily deployed to translation-gh-2236-lua-style October 6, 2021 09:52 Inactive
@github-actions github-actions bot temporarily deployed to branch-gh-2236-lua-style October 6, 2021 09:52 Inactive
@github-actions github-actions bot temporarily deployed to branch-gh-2236-lua-style October 6, 2021 10:09 Inactive
@github-actions github-actions bot temporarily deployed to translation-gh-2236-lua-style October 6, 2021 10:09 Inactive
@NickVolynkin NickVolynkin merged commit 7073e32 into latest Oct 6, 2021
@NickVolynkin NickVolynkin deleted the gh-2236-lua-style branch October 6, 2021 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[1pt] feedback: Module key_def | Tarantool
4 participants