public STObject(STClass @class) { Class = @class; InstanceContext = new LocalContext(GlobalContext.Instance, true); InstanceContext.Declare("self"); InstanceContext.SetVariable("self", this); }
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); }); }
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; }
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; }
public STMethodBuilder(STClass buildingClass) : base() { BuildingClass = buildingClass; Class.MethodDictionary.Clear(); // Blank slate }
public STMetaclass(STClass instance) : base(instance.Name + " class") { Instance = instance; }
public STMethodPrototype(STClass @class, STSymbol selector, STSymbol[] parameterNames) { BuildingClass = @class; Selector = selector; ParameterNames = parameterNames; }