some aliases for splice:

function tuple:append (...)
  return tuple:splice(#tuple, 0, ...)
end

function tuple:insert(idx, ...)
  return tuple:splice(idx, 0, ...)
end

function tuple:remove(idx, count)
 if count == nil then
   count = 1
 end
 return tuple:splice(idx, count)
end


also it would be nice to have function tuple:find

local index = tuple:find(value)

if index ~= nil then
  local tuple_wo_value = tuple:splice(index, 1)
end


local indexes = { tuple:find(value) }

-- 
You received this bug notification because you are a member of Tarantool
Development Team, which is subscribed to tarantool.
https://bugs.launchpad.net/bugs/1028769

Title:
  please add method to tuple

Status in Tarantool - an efficient in-memory data store:
  Confirmed

Bug description:
  it would be nice to have a method tuple:append

  local tuple1 = box.select(10, 20);

  local tuple2 = tuple1:append(1,2,3)

  box.replace( 10, tuple2:unpack() )

  PS: also it would be nice to have method tuple:splice(offset, len,
  ...)

To manage notifications about this bug go to:
https://bugs.launchpad.net/tarantool/+bug/1028769/+subscriptions

_______________________________________________
Mailing list: https://launchpad.net/~tarantool-developers
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~tarantool-developers
More help   : https://help.launchpad.net/ListHelp

Reply via email to