public static IEnumerable Map(IApply func, IEnumerable[] seqs) { switch (seqs.Length) { case 1: { var args = new object[1]; foreach (var item in ToIter(seqs[0])) { args[0] = item; yield return(func.Apply(args)); } break; } case 2: { var args = new object[2]; var iter1 = ToIter(seqs[0]).GetEnumerator(); var iter2 = ToIter(seqs[1]).GetEnumerator(); while (iter1.MoveNext() && iter2.MoveNext()) { args[0] = iter1.Current; args[1] = iter2.Current; yield return(func.Apply(args)); } break; } case 3: { var args = new object[3]; var iter1 = ToIter(seqs[0]).GetEnumerator(); var iter2 = ToIter(seqs[1]).GetEnumerator(); var iter3 = ToIter(seqs[2]).GetEnumerator(); while (iter1.MoveNext() && iter2.MoveNext() && iter3.MoveNext()) { args[0] = iter1.Current; args[1] = iter2.Current; args[2] = iter3.Current; yield return(func.Apply(args)); } break; } default: { var iter = new UnisonEnumerator(seqs); foreach (Vector item in iter) { yield return(func.Apply(AsArray(item))); } break; } } }
private void sureButton_Click(object sender, EventArgs e) { TabPage page = this.tabControl.TabPages[this.tabControl.SelectedIndex]; IApply c = (IApply)page.Controls[0]; c.Apply(); }
public static object Funcall(IApply func, params object[] args) { if (func == null) { return(Identity(args)); } else { return(func.Apply(args)); } }
public async Task Save(T input) { if (input == null) { throw new ArgumentNullException(nameof(input)); } var item = await FindById(input.Id); if (item == null) { item = new T(); await Add(item); } _mapper.Apply(item, input); await _dbContext.SaveChangesAsync(); }
public static IEnumerable Map(IApply func, IEnumerable[] seqs) { switch (seqs.Length) { case 1: { var args = new object[1]; foreach (var item in ToIter(seqs[0])) { args[0] = item; yield return func.Apply(args); } break; } case 2: { var args = new object[2]; var iter1 = ToIter(seqs[0]).GetEnumerator(); var iter2 = ToIter(seqs[1]).GetEnumerator(); while (iter1.MoveNext() && iter2.MoveNext()) { args[0] = iter1.Current; args[1] = iter2.Current; yield return func.Apply(args); } break; } case 3: { var args = new object[3]; var iter1 = ToIter(seqs[0]).GetEnumerator(); var iter2 = ToIter(seqs[1]).GetEnumerator(); var iter3 = ToIter(seqs[2]).GetEnumerator(); while (iter1.MoveNext() && iter2.MoveNext() && iter3.MoveNext()) { args[0] = iter1.Current; args[1] = iter2.Current; args[2] = iter3.Current; yield return func.Apply(args); } break; } default: { var iter = new UnisonEnumerator(seqs); foreach (Vector item in iter) { yield return func.Apply(AsArray(item)); } break; } } }
public static int FuncallInt(IApply func, params object[] args) { return((int)func.Apply(args)); }
public static bool FuncallBool(IApply func, params object[] args) { return(ToBool(func.Apply(args))); }
public static object ApplyStar(IApply func, params object[] args) { return(func.Apply(MakeArrayStar(args))); }
public static object Apply(IApply func, object[] args) { return(func.Apply(args)); }
public static int FuncallInt(IApply func, params object[] args) { return (int)func.Apply(args); }
public static bool FuncallBool(IApply func, params object[] args) { return ToBool(func.Apply(args)); }
public static object Funcall(IApply func, params object[] args) { if (func == null) { return Identity(args); } else { return func.Apply(args); } }
public static object ApplyStar(IApply func, params object[] args) { return func.Apply(MakeArrayStar(args)); }
public static object Apply(IApply func, object[] args) { return func.Apply(args); }
public string Evaluate(Match match) { string result = MakeString(transform.Apply(RegexBind(match))); return(result); }