Esempio n. 1
0
 public ManifestInstance(StandardInstance closClass, object [] slotVector, FuncallHandler onFuncall)
 {
     this.serialNumber = nextSerialNumber++;
     this.closClass    = closClass;
     this.slotVector   = slotVector;
     this.onFuncall    = onFuncall;
 }
 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);
 }
 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, object [] slots, FuncallHandler funcallHandler)
 {
     return CreateInstance (closClass, slots, funcallHandler);
 }
 public static StandardInstance CreateFuncallableInstance(StandardInstance closClass, int nSlots, FuncallHandler funcallHandler)
 {
     return CreateInstance (closClass, nSlots, funcallHandler);
 }
 public static StandardInstance CreateFuncallableInstance(FuncallHandler funcallHandler)
 {
     return CreateInstance (null, 0, funcallHandler);
 }
 public ManifestInstance(StandardInstance closClass, object [] slotVector, FuncallHandler onFuncall)
 {
     this.serialNumber = nextSerialNumber++;
     this.closClass = closClass;
     this.slotVector = slotVector;
     this.onFuncall = onFuncall;
 }
Esempio n. 8
0
 public static StandardInstance CreateFuncallableInstance(StandardInstance closClass, object [] slots, FuncallHandler funcallHandler)
 {
     return(CreateInstance(closClass, slots, funcallHandler));
 }
Esempio n. 9
0
 public static StandardInstance CreateFuncallableInstance(FuncallHandler funcallHandler)
 {
     return(CreateInstance(null, 0, funcallHandler));
 }
Esempio n. 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));
 }
Esempio n. 11
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);
        }