fn do_record_elim(record: RcValue, label: &Label) -> Result<RcValue, NbeError> {
    match record.as_ref() {
        Value::RecordIntro(fields) => match fields.iter().find(|(l, _)| l == label) {
            Some((_, term)) => Ok(term.clone()),
            None => Err(NbeError::new(format!(
                "do_record_elim: field `{}` not found in record",
                label.0,
            ))),
        },
        Value::Neutral(head, spine) => {
            let mut spine = spine.clone();
            spine.push(Elim::Record(label.clone()));
            Ok(RcValue::from(Value::Neutral(*head, spine)))
        },
        _ => Err(NbeError::new("do_record_elim: not a record")),
    }
}
/// Return the field in from a record
Return the field in from a record
Return the field in from a record
fn do_record_elim(record: RcValue, label: &Label) -> Result<RcValue, NbeError> {
    match record.as_ref() {
        Value::RecordIntro(fields) => match fields.iter().find(|(l, _)| l == label) {
            Some((_, term)) => Ok(term.clone()),
            None => Err(NbeError::new(format!(
                "do_record_elim: field `{}` not found in record",
                label.0,
            ))),
        },
        Value::Neutral(head, spine) => {
            let mut spine = spine.clone();
            spine.push(Elim::Record(label.clone()));
            Ok(RcValue::from(Value::Neutral(*head, spine)))
        },
        _ => Err(NbeError::new("do_record_elim: not a record")),
    }
}
fn do_record_elim ( record : RcValue , label : & Label ) -> Result < RcValue , NbeError > { match record . as_ref ( ) { Value :: RecordIntro ( fields ) => match fields . iter ( ) . find ( | ( l , _ ) | l == label ) { Some ( ( _ , term ) ) => Ok ( term . clone ( ) ) , None => Err ( NbeError :: new ( format ! ( " " label 0 ) ) ) , } , Value :: Neutral ( head , spine ) => { let mut spine = spine . clone ( ) ; spine . push ( Elim :: Record ( label . clone ( ) ) ) ; Ok ( RcValue :: from ( Value :: Neutral ( * head , spine ) ) ) } , _ => Err ( NbeError :: new ( " " ) ) , } }
Return the field in from a record
Return the field in from a record
record
RcValue
label
&Label