Exemplo n.º 1
0
 public static SRUObject MakeFrame(SRUObject currnet_frame)
 {
     SRUObject frame = new SRUObject();
     frame["outside"] = currnet_frame;
     frame.RegesterMethod("field_missing", field_missing);
     return frame;
 }
Exemplo n.º 2
0
 public static void RegesterClass(SRUObject obj)
 {
     obj["name"] = "Class".ToSRUObject();
     obj["class"] = obj;
     obj["super"] = Library.Object;
     obj["field_missing"] = Library.FieldMissing;
     // TODO: Define method
     obj.RegesterInstanceMethod("find_field", find_field);
     obj.RegesterMethod("find_field", find_field);
     obj.RegesterInstanceMethod("inspect", inspect);
 }
Exemplo n.º 3
0
 public static void RegesterNumber(SRUObject obj)
 {
     obj["name"] = "Number".ToSRUObject();
     obj["class"] = Library.Klass;
     obj["super"] = Library.Object;
     obj["field_missing"] = Library.FieldMissing;
     // TODO: Define method of String Class
     obj.RegesterMethod("parse", parse);
     obj.RegesterInstanceMethod("inspect", inspect);
     obj.RegesterInstanceMethod("to_s", to_s);
     obj.RegesterInstanceMethod("add", add);
 }
Exemplo n.º 4
0
 public static void RegesterObject(SRUObject obj)
 {
     obj["name"] = "Object".ToSRUObject();
     obj["class"] = Library.Klass;
     obj["supper"] = Library.Nil;
     obj["field_missing"] = Library.FieldMissing;
     // TODO: Define method
     obj.RegesterMethod("new", new_);
     obj.RegesterInstanceMethod("invoke", invoke);
 }
Exemplo n.º 5
0
 public static void RegesterTrue(SRUObject True)
 {
     True["class"] = Library.Boolean;
     True["field_missing"] = Library.FieldMissing;
     True.RegesterMethod("if_true", True_if_true);
 }
Exemplo n.º 6
0
 public static void RegesterFalse(SRUObject False)
 {
     False["class"] = Library.Boolean;
     False["field_missing"] = Library.FieldMissing;
     False.RegesterMethod("if_true", False_if_true);
 }