Skip to content

[1pt] feedback: space_object:on_replace(): erroneous example #2377

Closed
@TarantoolBot

Description

@TarantoolBot

Make the example clearer

Product: Tarantool
Audience/target: dev
Root document: https://www.tarantool.io/ru/doc/latest/reference/reference_lua/box_space/on_replace/
SME: @ alyapunov

Looks like the example is confusing and needs to be revised.
Consider declaring x explicitly:

x = 0
function f()...

X (capital X) is the name of a space. Consider changing this name to a more descriptive one.


<…>ся в разделе Триггеры.
См. также space_object:before_replace().
|Пример 1:
COPYfunction f ()
x = x + 1
end
box.space.X:on_replace(f)tarantool> function f ()
> x = x + 1
> end
tarantool> box.space.X:on_replace(f)|

Пример 2:
В функции с триггером может быть до 4 параметров:

<…>

https://www.tarantool.io/ru/doc/latest/reference/reference_lua/box_space/on_replace/

здесь ошибка? Почему у триггера нет аргументов, и откуда берется переменная "x"?

Metadata

Metadata

Assignees

No one assigned

    Labels

    exampleProblem with a code example.rewrite[nature] Revise existing text for structure/phrasing/termsserver[area] Task relates to Tarantool's server (core) functionalitytriggers[area] Related to triggers

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions