public void CreateSimpleTuple() { Tuple tuple = new Tuple(new object[] { 1, 2, 3 }); Assert.AreEqual(3, tuple.Arity); Assert.AreEqual(1, tuple.ElementAt(0)); Assert.AreEqual(2, tuple.ElementAt(1)); Assert.AreEqual(3, tuple.ElementAt(2)); }
public bool Match(Tuple tuple, Context context) { if (tuple == null) return false; if (tuple.Arity != this.Arity) return false; for (int k = 0; k < this.elements.Count && context != null; k++) if (!AjErl.MatchUtilities.MatchObjects(this.elements[k], tuple.ElementAt(k), context)) return false; return true; }
public bool Match(Tuple tuple, Context context) { if (tuple == null) { return(false); } if (tuple.Arity != this.Arity) { return(false); } for (int k = 0; k < this.elements.Count && context != null; k++) { if (!AjErl.MatchUtilities.MatchObjects(this.elements[k], tuple.ElementAt(k), context)) { return(false); } } return(true); }