asInt() public method

public asInt ( ) : int
return int
示例#1
0
文件: IoList.cs 项目: ypyf/io
        public static IoObject slotAt(IoObject target, IoObject locals, IoObject message)
        {
            IoMessage m   = message as IoMessage;
            IoNumber  ind = m.localsNumberArgAt(locals, 0);
            IoList    o   = target as IoList;
            IoObject  v   = o.list[ind.asInt()] as IoObject;

            return(v == null ? target.state.ioNil : v);
        }
示例#2
0
        public static IoObject slotAt(IoObject target, IoObject locals, IoObject message)
        {
            IoMessage m   = message as IoMessage;
            IoSeq     o   = target as IoSeq;
            IoSeq     res = IoSeq.createObject(target.state);
            IoNumber  arg = m.localsNumberArgAt(locals, 0);

            res.value += o.value.Substring(arg.asInt(), 1);
            return(res);
        }
示例#3
0
文件: IoList.cs 项目: ypyf/io
        public static IoObject slotRemoveAt(IoObject target, IoObject locals, IoObject message)
        {
            IoMessage m   = message as IoMessage;
            IoNumber  ind = m.localsNumberArgAt(locals, 0);
            IoList    o   = target as IoList;

            try
            {
                o.list.RemoveAt(ind.asInt());
                return(target);
            }
            catch (ArgumentOutOfRangeException aoore)
            {
                object ex = aoore;
                return(target.state.ioNil);
            }
        }