public override bool match(Erlang.Object pattern, Erlang.VarBind binding) { if (binding == null) { return(false); } Erlang.Object value = binding.find(m_var); if (value != null) { return(value.match(pattern, binding)); } Erlang.Object term = null; binding[m_var] = pattern.subst(ref term, binding) ? term : pattern; return(true); }
public override bool match(Erlang.Object pattern, VarBind binding) { if (pattern is Erlang.Var) { pattern.match(this, binding); } else if (!(pattern is Erlang.Tuple)) { return(false); } Erlang.Tuple tup = pattern as Erlang.Tuple; if (arity() != tup.arity()) { return(false); } for (int i = 0; i < arity(); ++i) { if (!elems[i].match(tup[i], binding)) { return(false); } } return(true); }
public virtual bool match(Erlang.Object pattern, Erlang.VarBind binding) { return((pattern is Erlang.Var) ? pattern.match(this, binding) : this.Equals(pattern)); }