updateSlotShared

Extract the current value of the slot, pass it to the supplied inline Kotlin function, make it shared, and write the result back to the slot.