to mdsetitem :index :array :val
if not list?  :index [(throw "error 4 :index)]
if not array? :array [(throw "error 4 :array)]
setitem last :index (mditem butlast :index :array) :val
end

bury "mdsetitem
