Linear operators on maps and big maps
Thanks to the promotion of UNPAIR
as a new instruction (see !54 (merged)), it is possible to destruct pairs (and in particular nested pairs) without duplicating the whole structure (as the UNPAIR
macro previously did) nor discarding part of it (as CAR
and CDR
do). This MR extends this feature to maps and big maps by providing a linear operator that combines GET
and UPDATE
(and has thus been called GET_AND_UPDATE
).
The motivation for this work is to allow a simpler implementation of tickets (the feature proposed in !136 (closed)) in which DUP
is forbidden for all values containing tickets (including map _ (ticket _)
and big_map _ (ticket _)
). See !328 (merged) .
Edited by Raphaël Cauderlier