public static STSymbol Get(string name) { STSymbol value; if (!symbols.TryGetValue(name, out value)) { value = new STSymbol(name); symbols[name] = value; } return value; }
public STClass SubclassNamespaceWith(STSymbol name, STObject nsObj, STBlock blockObj) { var @class = SubclassNamespace(name, nsObj); @class.With(blockObj as STBlock); return @class; }
public STClass SubclassNamespace(STSymbol name, STObject nsObj) { var ns = nsObj as STNamespace; if (ns == null) throw new Exception ("namespace parameter must hold a valid Namespace object, not " + nsObj.GetType().FullName); var @class = Subclass(name); ns.Install(name, @class); return @class; }
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 virtual STObject Send(STSymbol message, params STObject[] args) { STMessage msg = new STMessage (this, message, args); try { return Class.RouteMessage(msg); } catch (MessageNotUnderstood e) { if (message.Name == "doesNotUnderstand:") throw e; // avoid infinite recursion return Send (STSymbol.Get("doesNotUnderstand:"), msg); } }
public void Install(STSymbol key, STObject value) { Map[key] = value; }
public STMessage(STObject receiver, STSymbol message, params STObject[] args) { Receiver = receiver; Selector = message; Parameters = args; }
public STMethodPrototype(STClass @class, STSymbol selector, STSymbol[] parameterNames) { BuildingClass = @class; Selector = selector; ParameterNames = parameterNames; }