mtree_get currently returns [VALUE, ROOT] on the stack. The root is unchanged from the operation, so there's no need to return it. If the user still wants the root, than it can dupw it before the call.
The current implementation results in the caller needing to add swapw dropw to drop the root in all cases where the root is already preserved elsewhere on the stack, such as this one, and in the new smt implementation.
This is not a good idea, because to return only V, mtree_get internally would need to essentially run a swapw dropw. It's better to let the user do it if needed (and leave it as is if not).
mtree_get
currently returns[VALUE, ROOT]
on the stack. The root is unchanged from the operation, so there's no need to return it. If the user still wants the root, than it candupw
it before the call.The current implementation results in the caller needing to add
swapw dropw
to drop the root in all cases where the root is already preserved elsewhere on the stack, such as this one, and in the newsmt
implementation.