pub fn define_multi(&self, names: &[Name], value: &Value) {
        if names.len() == 1 {
            self.define(names[0].clone(), value);
        } else {
            let values = value.clone().iter_items();
            if values.len() > names.len() {
                panic!(
                    "Expected {} values, but got {}",
                    names.len(),
                    values.len(),
                )
            } else {
                let mut values = values.iter();
                for name in names {
                    self.define(
                        name.clone(),
                        values.next().unwrap_or(&Value::Null),
                    )
                }
            }
        }
    }
/// Define multiple names from a value that is a list.
/// Special case: in names is a single name, value is used directly.
Define multiple names from a value that is a list.
Special case: in names is a single name, value is used directly.
Define multiple names from a value that is a list . Special case : in names is a single name value is used directly .
pub fn define_multi(&self, names: &[Name], value: &Value) {
        if names.len() == 1 {
            self.define(names[0].clone(), value);
        } else {
            let values = value.clone().iter_items();
            if values.len() > names.len() {
                panic!(
                    "Expected {} values, but got {}",
                    names.len(),
                    values.len(),
                )
            } else {
                let mut values = values.iter();
                for name in names {
                    self.define(
                        name.clone(),
                        values.next().unwrap_or(&Value::Null),
                    )
                }
            }
        }
    }
pub fn define_multi ( & self , names : & [ Name ] , value : & Value ) { if names . len ( ) == 1 { self . define ( names [ 0 ] . clone ( ) , value ) ; } else { let values = value . clone ( ) . iter_items ( ) ; if values . len ( ) > names . len ( ) { panic ! ( " " names len ( ) values len ( ) ) } else { let mut values = values . iter ( ) ; for name in names { self . define ( name . clone ( ) , values . next ( ) . unwrap_or ( & Value :: Null ) , ) } } } }
Define multiple names from a value that is a list.
Define multiple names from a value that is a list .
&self
names
&[Name]
value
&Value
&self
names
&[Name]
value
&Value