// Variable lookup against a Value context.

///|
/// Look up a field in a Value context.
/// Returns `Null` when the field is absent or the context is not an object.
pub fn lookup(field : String, ctx : Value) -> Value {
  match ctx {
    Object(entries) => {
      let mut result : Value = Null
      for entry in entries {
        let (k, v) = entry
        if k == field {
          result = v
        }
      }
      result
    }
    _ => Null
  }
}