상속: STRuntimeObject
예제 #1
0
        public static STSymbol Get(string name)
        {
            STSymbol value;
            if (!symbols.TryGetValue(name, out value)) {
                value = new STSymbol(name);
                symbols[name] = value;
            }

            return value;
        }
예제 #2
0
 public STClass SubclassNamespaceWith(STSymbol name, STObject nsObj, STBlock blockObj)
 {
     var @class = SubclassNamespace(name, nsObj);
     @class.With(blockObj as STBlock);
     return @class;
 }
예제 #3
0
        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;
        }
예제 #4
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;
        }
예제 #5
0
 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);
     }
 }
예제 #6
0
 public void Install(STSymbol key, STObject value)
 {
     Map[key] = value;
 }
예제 #7
0
 public STMessage(STObject receiver, STSymbol message, params STObject[] args)
 {
     Receiver = receiver;
     Selector = message;
     Parameters = args;
 }
예제 #8
0
 public STMethodPrototype(STClass @class, STSymbol selector, STSymbol[] parameterNames)
 {
     BuildingClass = @class;
     Selector = selector;
     ParameterNames = parameterNames;
 }