/// Overwrites the value at `address`; does not adjust permissions at all.
Overwrites the value at `address`; does not adjust permissions at all.
Overwrites the value at ` address ` ; does not adjust permissions at all .
pub(super) fn poke(&mut self, address: Address, value: Value) -> eyre::Result<()> {
        match address {
            Address::Local(lv) => self.machine[lv] = value,
            Address::Constant(_) => {
                return Err(error!(
                    self.machine.pc().span(self.db),
                    "cannot store into a constant"
                )
                .eyre(self.db))
            }
            Address::Field(o, f) => match &mut self.machine[o] {
                ObjectData::Instance(i) => i.fields[f] = value,
                ObjectData::Tuple(v) => v.fields[f] = value,
                d => panic!("unexpected thing with fields: {d:?}"),
            },
        }
        Ok(())
    }
pub ( super ) fn poke ( & mut self , address : Address , value : Value ) -> eyre :: Result < ( ) > { match address { Address :: Local ( lv ) => self . machine [ lv ] = value , Address :: Constant ( _ ) => { return Err ( error ! ( self machine pc ( ) span ( self db ) " " ) . eyre ( self . db ) ) } Address :: Field ( o , f ) => match & mut self . machine [ o ] { ObjectData :: Instance ( i ) => i . fields [ f ] = value , ObjectData :: Tuple ( v ) => v . fields [ f ] = value , d => panic ! ( " " ) , } , } Ok ( ( ) ) }
Overwrites the value at `address`; does not adjust permissions at all.
Overwrites the value at ` address ` ; does not adjust permissions at all .
&mut self
address
Address
value
Value