Description
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"?