public bool CanConvert(TermType type) { return(TypeSystem.CanConvert(this.Type, type)); }
public override object ExecuteResult(DrawTheory theory, IEnumerable <IFunctionInstance> arguments, IEnumerable <IAtom> body) { object[] val = EnumerableUtils.FirstsLast(EnumerableUtils.HeadTail(theory, TypeSystem.GetArguments(arguments, this.TermTypes, this.Method.GetParameters().Skip(0x01).SkipLast(0x01).Select(x => x.ParameterType))), body).ToArray(); try { return(this.Method.Invoke(null, val)); } catch (Exception e) { Console.Error.WriteLine("Could not execute the {0} atom.", this.TermString(arguments)); Console.Error.WriteLine(string.Join(" ; ", val.Select(x => x.GetType()))); Console.Error.WriteLine(e); return(null); } }