ConvertToInt() public static method

public static ConvertToInt ( object o ) : int
o object
return int
コード例 #1
0
            protected override object Read(PushbackTextReader r, char pct)
            {
                int ch = r.Read();

                Unread(r, ch);
                //% alone is first arg
                if (ch == -1 || isWhitespace(ch) || isTerminatingMacro(ch))
                {
                    return(registerArg(1));
                }
                //object n = ReadAux(r, true, null, true);
                object n = ReadAux(r);

                if (n.Equals(Compiler._AMP_))
                {
                    return(registerArg(-1));
                }
                if (!Util.IsNumeric(n))
                {
                    throw new ArgumentException("arg literal must be %, %& or %integer");
                }
                return(registerArg(Util.ConvertToInt(n)));
            }
コード例 #2
0
 public override object invoke(object arg1)
 {
     return(nth(Util.ConvertToInt(arg1)));
 }
コード例 #3
0
ファイル: ArraySeq.cs プロジェクト: stjordanis/clojure-clr
 protected override int Convert(object x)
 {
     return(Util.ConvertToInt(x));
 }