示例#1
0
 object Funcall2(StandardInstance self, object [] arguments)
 {
     Utility.Ignore(self);
     if (arguments.Length != 1)
         throw new NotImplementedException ("funcall2");
     return del.DynamicInvoke (null, arguments [0]);
 }
示例#2
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));
 }
示例#3
0
 public ManifestInstance(StandardInstance closClass, object [] slotVector, FuncallHandler onFuncall)
 {
     this.serialNumber = nextSerialNumber++;
     this.closClass    = closClass;
     this.slotVector   = slotVector;
     this.onFuncall    = onFuncall;
 }
示例#4
0
        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);
        }
示例#5
0
 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]));
 }
示例#6
0
        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);
        }
示例#7
0
 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));
 }
示例#8
0
 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 ();
 }
示例#10
0
 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);
 }
示例#11
0
 public static StandardInstance CreateInstance(StandardInstance closClass, object [] slots)
 {
     return CreateInstance (closClass, slots, funcallStandardInstance);
 }
示例#12
0
 public static StandardInstance CreateFuncallableInstance(StandardInstance closClass, object [] slots, FuncallHandler funcallHandler)
 {
     return CreateInstance (closClass, slots, funcallHandler);
 }
示例#13
0
 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();
 }
示例#14
0
 static object funcallStandardInstance(StandardInstance self, object [] arguments)
 {
     throw new NotImplementedException("Attempt to apply non function " + self + " to " + arguments.ToString());
 }
示例#15
0
 public static StandardInstance CreateFuncallableInstance(StandardInstance closClass, int nSlots)
 {
     return CreateInstance (closClass, nSlots, funcallUninitializedInstance);
 }
示例#16
0
 public static StandardInstance CreateFuncallableInstance(StandardInstance closClass, int nSlots, FuncallHandler funcallHandler)
 {
     return CreateInstance (closClass, nSlots, funcallHandler);
 }
示例#17
0
 public static StandardInstance CreateInstance(StandardInstance closClass, int nSlots)
 {
     return(CreateInstance(closClass, nSlots, funcallStandardInstance));
 }
示例#18
0
 public static StandardInstance CreateInstance(StandardInstance closClass, int nSlots)
 {
     return CreateInstance (closClass, nSlots, funcallStandardInstance);
 }
示例#19
0
 public static StandardInstance CreateInstance(StandardInstance closClass, object [] slots)
 {
     return(CreateInstance(closClass, slots, funcallStandardInstance));
 }
示例#20
0
 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;
 }
示例#21
0
 public static StandardInstance CreateFuncallableInstance(StandardInstance closClass, int nSlots)
 {
     return(CreateInstance(closClass, nSlots, funcallUninitializedInstance));
 }
示例#22
0
 static object funcallStandardInstance(StandardInstance self, object [] arguments)
 {
     throw new NotImplementedException ("Attempt to apply non function " + self + " to " + arguments.ToString ());
 }
示例#23
0
 public static StandardInstance CreateFuncallableInstance(StandardInstance closClass, object [] slots, FuncallHandler funcallHandler)
 {
     return(CreateInstance(closClass, slots, funcallHandler));
 }
示例#24
0
 object Funcall(StandardInstance self, object [] arguments)
 {
     return del.DynamicInvoke (PrePend (self, arguments));
 }
示例#25
0
 object Funcall(StandardInstance self, object [] arguments)
 {
     return(del.DynamicInvoke(PrePend(self, arguments)));
 }
示例#26
0
 object Funcall1r(StandardInstance self, object [] arguments)
 {
     Utility.Ignore(self);
     return del.DynamicInvoke (null, arguments);
 }
示例#27
0
 public ManifestInstance(StandardInstance closClass, object [] slotVector, FuncallHandler onFuncall)
 {
     this.serialNumber = nextSerialNumber++;
     this.closClass = closClass;
     this.slotVector = slotVector;
     this.onFuncall = onFuncall;
 }
示例#28
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);
 }
示例#29
0
 object Funcall1r(StandardInstance self, object [] arguments)
 {
     Utility.Ignore(self);
     return(del.DynamicInvoke(null, arguments));
 }