pub fn set_local(&mut self, index: usize) {
        let local_index = self.frame_index() + index + 1;

        match self.stack.len() - 1 {
            // local is already in the correct spot; we declare it
            n if n == local_index => return,
            n if n < local_index => {
                // println!("{} < {}", self.stack.len() - 1, local_index);
                unreachable!("Can not set local that is not yet on stack");
            }
            _ => (),
        }

        // get the old local
        let slot = self.swap(local_index, Tagged::not_init()).slot();

        // replace the old value with the new one if on the heap
        let tagged = match slot {
            // if it's data we just grab it
            Slot::Data(_) => self.stack.pop().unwrap(),
            // if it is on the heap, we replace in the old value
            Slot::Ref(ref cell) => {
                // TODO: check types?
                mem::drop(cell.replace(self.pop_data()));
                Tagged::new(slot)
            },
            // if it's anything else, we're sad.
            Slot::Frame => unreachable!("Expected data, found frame"),
            Slot::Suspend(_) => unreachable!("Expected data, found *suspended* frame buried deep in the stack, which makes even less sense, because this should be a local variable"),
            Slot::NotInit => unreachable!("Expected data, found data. Wait! It's unitialized? Maybe this is allowed?"),
        };

        mem::drop(self.swap(local_index, tagged))
    }
Sets a local - note that this function doesn't do much.
It's a simple swap-and-drop.
If a new local is being declared,
it's literally a bounds-check and no-op.
passerine/src/vm/stack.rs