當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。