object Funcall2(StandardInstance self, object [] arguments) { Utility.Ignore(self); if (arguments.Length != 1) throw new NotImplementedException ("funcall2"); return del.DynamicInvoke (null, arguments [0]); }
object Funcall2r(StandardInstance self, object [] arguments) { Utility.Ignore(self); object [] remaining = new object [arguments.Length - 1]; Array.Copy(arguments, 1, remaining, 0, arguments.Length - 1); return(del.DynamicInvoke(null, arguments [0], remaining)); }
public ManifestInstance(StandardInstance closClass, object [] slotVector, FuncallHandler onFuncall) { this.serialNumber = nextSerialNumber++; this.closClass = closClass; this.slotVector = slotVector; this.onFuncall = onFuncall; }
object Funcall(StandardInstance self, object [] arguments) { Utility.Ignore(self); ParameterInfo [] parameters = del.Method.GetParameters(); ParameterInfo lastParameter = parameters [parameters.Length - 1]; object [] attr = lastParameter.GetCustomAttributes(typeof(System.ParamArrayAttribute), false); switch (parameters.Length) { case 2: if (attr.Length > 0) { // 2 or more arguments return(del.DynamicInvoke(null, arguments)); } else { // exactly 2 arguments throw new NotImplementedException(); } default: throw new NotImplementedException(); } // return del.DynamicInvoke (null, arguments); }
object Funcall3(StandardInstance self, object [] arguments) { Utility.Ignore(self); if (arguments.Length != 2) { throw new NotImplementedException("funcall3"); } return(del.DynamicInvoke(null, arguments [0], arguments[1])); }
static StandardInstance CreateInstance(StandardInstance closClass, object [] slots, FuncallHandler method) { StandardInstance answer = (StandardInstance)Delegate.CreateDelegate(typeof(StandardInstance), new ManifestInstance(closClass, slots, method), typeof(ManifestInstance) .GetMethod("DefaultInstanceMethod", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)); ((ManifestInstance)answer.Target).self = answer; return(answer); }
static StandardInstance CreateInstance(StandardInstance closClass, int nSlots, FuncallHandler method) { object [] slotVector = null; if (nSlots > 0) { slotVector = new object [nSlots]; for (int i = 0; i < nSlots; i++) { slotVector [i] = UnboundSlotValue; } } return(CreateInstance(closClass, nSlots == 0 ? null : slotVector, method)); }
object Funcall(StandardInstance self, object [] arguments) { Utility.Ignore(self); ParameterInfo [] parameters = del.Method.GetParameters (); ParameterInfo lastParameter = parameters [parameters.Length - 1]; object [] attr = lastParameter.GetCustomAttributes (typeof (System.ParamArrayAttribute), false); switch (parameters.Length) { case 2: if (attr.Length > 0) { // 2 or more arguments return del.DynamicInvoke (null, arguments); } else { // exactly 2 arguments throw new NotImplementedException (); } default: throw new NotImplementedException (); } // return del.DynamicInvoke (null, arguments); }
static object funcallUninitializedInstance(StandardInstance self, object [] arguments) { // throw new NotImplementedException (self.ToString () + ": Attempt to apply uninitialized " + ((Symbol) CL.ClassName (((ManifestInstance) self.Target).Class)).Name + " to " + arguments.ToString ()); throw new NotImplementedException (); }
static StandardInstance CreateInstance(StandardInstance closClass, int nSlots, FuncallHandler method) { object [] slotVector = null; if (nSlots > 0) { slotVector = new object [nSlots]; for (int i = 0; i < nSlots; i++) slotVector [i] = UnboundSlotValue; } return CreateInstance (closClass, nSlots == 0 ? null : slotVector, method); }
public static StandardInstance CreateInstance(StandardInstance closClass, object [] slots) { return CreateInstance (closClass, slots, funcallStandardInstance); }
public static StandardInstance CreateFuncallableInstance(StandardInstance closClass, object [] slots, FuncallHandler funcallHandler) { return CreateInstance (closClass, slots, funcallHandler); }
static object funcallUninitializedInstance(StandardInstance self, object [] arguments) { // throw new NotImplementedException (self.ToString () + ": Attempt to apply uninitialized " + ((Symbol) CL.ClassName (((ManifestInstance) self.Target).Class)).Name + " to " + arguments.ToString ()); throw new NotImplementedException(); }
static object funcallStandardInstance(StandardInstance self, object [] arguments) { throw new NotImplementedException("Attempt to apply non function " + self + " to " + arguments.ToString()); }
public static StandardInstance CreateFuncallableInstance(StandardInstance closClass, int nSlots) { return CreateInstance (closClass, nSlots, funcallUninitializedInstance); }
public static StandardInstance CreateFuncallableInstance(StandardInstance closClass, int nSlots, FuncallHandler funcallHandler) { return CreateInstance (closClass, nSlots, funcallHandler); }
public static StandardInstance CreateInstance(StandardInstance closClass, int nSlots) { return(CreateInstance(closClass, nSlots, funcallStandardInstance)); }
public static StandardInstance CreateInstance(StandardInstance closClass, int nSlots) { return CreateInstance (closClass, nSlots, funcallStandardInstance); }
public static StandardInstance CreateInstance(StandardInstance closClass, object [] slots) { return(CreateInstance(closClass, slots, funcallStandardInstance)); }
static StandardInstance CreateInstance(StandardInstance closClass, object [] slots, FuncallHandler method) { StandardInstance answer = (StandardInstance) Delegate.CreateDelegate (typeof (StandardInstance), new ManifestInstance (closClass, slots, method), typeof (ManifestInstance) .GetMethod ("DefaultInstanceMethod", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic)); ((ManifestInstance) answer.Target).self = answer; return answer; }
public static StandardInstance CreateFuncallableInstance(StandardInstance closClass, int nSlots) { return(CreateInstance(closClass, nSlots, funcallUninitializedInstance)); }
static object funcallStandardInstance(StandardInstance self, object [] arguments) { throw new NotImplementedException ("Attempt to apply non function " + self + " to " + arguments.ToString ()); }
public static StandardInstance CreateFuncallableInstance(StandardInstance closClass, object [] slots, FuncallHandler funcallHandler) { return(CreateInstance(closClass, slots, funcallHandler)); }
object Funcall(StandardInstance self, object [] arguments) { return del.DynamicInvoke (PrePend (self, arguments)); }
object Funcall(StandardInstance self, object [] arguments) { return(del.DynamicInvoke(PrePend(self, arguments))); }
object Funcall1r(StandardInstance self, object [] arguments) { Utility.Ignore(self); return del.DynamicInvoke (null, arguments); }
object Funcall2r(StandardInstance self, object [] arguments) { Utility.Ignore(self); object [] remaining = new object [arguments.Length - 1]; Array.Copy (arguments, 1, remaining, 0, arguments.Length - 1); return del.DynamicInvoke (null, arguments [0], remaining); }
object Funcall1r(StandardInstance self, object [] arguments) { Utility.Ignore(self); return(del.DynamicInvoke(null, arguments)); }