当前位置: 首页>>代码示例>>C#>>正文


C# NETRuby.RBasic类代码示例

本文整理汇总了C#中NETRuby.RBasic的典型用法代码示例。如果您正苦于以下问题:C# RBasic类的具体用法?C# RBasic怎么用?C# RBasic使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RBasic类属于NETRuby命名空间,在下文中一共展示了RBasic类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ruby_float

 public object ruby_float(RBasic r, params object[] o)
 {
     if (o[0] == null || o[0] == ruby.oNil) return new RFloat(ruby, 0.0);
 
     RBasic x = ruby.InstanceOf(o[0]);
     return (RFloat)ruby.ConvertType(x, typeof(RFloat), "Float", "to_f");
 }
开发者ID:emtees,项目名称:old-code,代码行数:7,代码来源:Kernel.cs

示例2: RBasic

        internal RBasic(RBasic o)
        {
            ruby = o.ruby;
            if (o.klass is RSingletonClass)
            {
                RMetaObject org = o.klass;
                RMetaObject meta = (RMetaObject)org.Clone();
                if (meta.m_tbl == null) meta.m_tbl = new st_table();
                else meta.m_tbl.Clear();
/*
                foreach (DictionaryEntry ent in org.m_tbl)
                {
                    RNMethod m = (RNMethod)ent.Value;
                    meta.m_tbl.Add(ent.Key, new RNMethod(m));
                }
*/
                klass = meta;
            }
            else
            {
                klass = o.klass;
            }
            flags = o.flags;
/*            
            if (o.Test(FL.EXIVAR))
            {
                ruby.CloneGenericIVar(this, o);
            }
*/            
            GetHashCode();        // define ID
        }
开发者ID:emtees,项目名称:old-code,代码行数:31,代码来源:Object.cs

示例3: ruby_p

 public object ruby_p(RBasic r, params object[] o)
 {
     foreach (object x in o)
     {
         System.Console.Out.Write(RString.AsString(ruby, ruby.Inspect(x)) + ruby.defaultRecSep);
     }
     // check defout and if file, then flush
     return null;
 }
开发者ID:emtees,项目名称:old-code,代码行数:9,代码来源:IO.cs

示例4: find_all

        private static object find_all(RBasic r, params object[] args)
        {
/*        
            NetRuby ruby = r.ruby;
            RArray ary = new RArray(ruby, true);
            ruby.Iterate(new NetRuby.IterationProc(Each), r,
                         new NetRuby.BlockProc(find_all_i), ary);
            return ary;
*/
            return null; //PH
        }
开发者ID:emtees,项目名称:old-code,代码行数:11,代码来源:Enum.cs

示例5: collect

        private static object collect(RBasic r, params object[] args)
        {
/*        
            NetRuby ruby = r.ruby;
            RArray ary = new RArray(ruby, true);
            ruby.Iterate(new NetRuby.IterationProc(Each), r,
                         (ruby.IsBlockGiven) ? new NetRuby.BlockProc(collect_i) :
                                               new NetRuby.BlockProc(enum_all), ary);
            return ary;
*/
            return null; //PH
        }
开发者ID:emtees,项目名称:old-code,代码行数:12,代码来源:Enum.cs

示例6: ruby_array

 public object ruby_array(RBasic r, params object[] o)
 {
     RBasic x = ruby.InstanceOf(o[0]);
     object val;
     uint to_ary = ruby.intern("to_ary");
     if (x.RespondTo(to_ary, false))
         val = ruby.Funcall(x, to_ary, null);
     else
         val = ruby.Funcall(x, ruby.intern("to_a"), null);
     if (val is RArray == false)
         throw new eTypeError("`to_a' did not return Array");
     return (RArray)val;
 }
开发者ID:emtees,项目名称:old-code,代码行数:13,代码来源:Kernel.cs

示例7: IsKindOf

 public object IsKindOf(RBasic obj, params object[] o)
 {
     RMetaObject cl = ruby.ClassOf(obj);
     object c = o[0];
     if (c is RMetaObject == false)
     {
         throw new eTypeError("class or module required");
     }
     while (cl != null)
     {
         if (cl == c || cl.m_tbl == ((RMetaObject)c).m_tbl)
             return true;
         cl = cl.super;
     }
     return false;
 }
开发者ID:emtees,项目名称:old-code,代码行数:16,代码来源:Kernel.cs

示例8: IsInstanceOf

 public object IsInstanceOf(RBasic r, params object[] args)
 {
     object o = args[0];
     if (o == null)
     {
         return (r == ruby.oNil) ? true : false;
     }
     else if (o is bool)
     {
         return ((bool)o) ? r == ruby.oTrue : r == ruby.oFalse;
     }
     else if (o is RMetaObject == false)
     {
         throw new eTypeError("class or module required");
     }
     return r.Class == o;
 }
开发者ID:emtees,项目名称:old-code,代码行数:17,代码来源:Kernel.cs

示例9: ruby_print

 public object ruby_print(RBasic r, params object[] o)
 {
     string s = String.Empty;
     if (o.Length == 0)
     {
         s = obj_to_s(NetRuby.lastLineGetter(0, null, ruby));
     }
     else
     {
         foreach (object x in o)
         {
             s += obj_to_s(x);
         }
     }
     System.Console.Out.Write(s);
     return null;
 }
开发者ID:emtees,项目名称:old-code,代码行数:17,代码来源:IO.cs

示例10: Call

 // A block argument to blocks is allowed in newer versions of Ruby
 public abstract RBasic Call(RThread thread, RBasic[] args, RCBlock block);
开发者ID:emtees,项目名称:old-code,代码行数:2,代码来源:codegen.cs

示例11: inspect_join

 private object inspect_join(RBasic ary, object[] args)
 {
     RString rs = ((RArray)args[0]).Join(args[1]);
     return rs;
 }
开发者ID:emtees,项目名称:old-code,代码行数:5,代码来源:Array.cs

示例12: AssocNew

 static public RArray AssocNew(NetRuby ruby, RBasic car, RBasic cdr)
 {
     ArrayList ar = new ArrayList();
     ar.Add(car);
     ar.Add(cdr);
     return new RArray(ruby, ar);
 }
开发者ID:emtees,项目名称:old-code,代码行数:7,代码来源:Array.cs

示例13: add

 static internal object add(RBasic r, params object[] args)
 {
     return ((RThreadGroup)r).Add(args[0]);
 }
开发者ID:emtees,项目名称:old-code,代码行数:4,代码来源:Thread.cs

示例14: tg_new

 static internal object tg_new(RBasic r, params object[] args)
 {
     return NewThreadGroup(args, (RMetaObject)r);
 }
开发者ID:emtees,项目名称:old-code,代码行数:4,代码来源:Thread.cs

示例15: thread_aset

 static internal object thread_aset(RBasic r, params object[] args)
 {
     return ((RThread)r).SetTLS(args[0], args[1]);
 }
开发者ID:emtees,项目名称:old-code,代码行数:4,代码来源:Thread.cs


注:本文中的NETRuby.RBasic类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。