Inheritance: STClassDescription
Ejemplo n.º 1
0
 public STObject(STClass @class)
 {
     Class = @class;
     InstanceContext = new LocalContext(GlobalContext.Instance, true);
     InstanceContext.Declare("self");
     InstanceContext.SetVariable("self", this);
 }
Ejemplo n.º 2
0
        public STClass(STClass superclass, string name)
            : this(name)
        {
            this.superclass = superclass;

            Metaclass.MethodDictionary[STSymbol.Get("new")] = new STRuntimeMethod(delegate (STMessage msg)
                {
                    return new STObject(this);
                });
        }
Ejemplo n.º 3
0
        public STClass Subclass(STSymbol name)
        {
            Console.WriteLine ("Creating subclass of {0} named '{1}'", Type.FullName, name.Name);

            var @class = new STClass(this, name.Name);
            @class.Initialize();
            return @class;
        }
Ejemplo n.º 4
0
        public static STClass GetForCLR(Type type, string branding)
        {
            STClass @class;
            if (!clrClasses.TryGetValue(type, out @class)) {
                @class = new STClass(type, branding);
                @class.Initialize();
                clrClasses[type] = @class;
            }

            return @class;
        }
Ejemplo n.º 5
0
 public STMethodBuilder(STClass buildingClass)
     : base()
 {
     BuildingClass = buildingClass;
     Class.MethodDictionary.Clear(); // Blank slate
 }
Ejemplo n.º 6
0
 public STMetaclass(STClass instance)
     : base(instance.Name + " class")
 {
     Instance = instance;
 }
Ejemplo n.º 7
0
 public STMethodPrototype(STClass @class, STSymbol selector, STSymbol[] parameterNames)
 {
     BuildingClass = @class;
     Selector = selector;
     ParameterNames = parameterNames;
 }