lookupMap() 공개 메소드

public lookupMap ( object k ) : object
k object
리턴 object
예제 #1
0
파일: IoBDB.cs 프로젝트: MilkTool/io-clr
        public static IoObject slotHasKey(IoObject target, IoObject locals, IoObject message)
        {
            IoMap     dict = target as IoMap;
            IoMessage m    = message as IoMessage;
            IoObject  key  = m.localsValueArgAt(locals, 0);

            if (dict.lookupMap(key) == null)
            {
                return(dict.tag.state.ioFalse);
            }
            return(dict.tag.state.ioTrue);
        }
예제 #2
0
파일: IoBDB.cs 프로젝트: MilkTool/io-clr
        public static IoObject slotAtIfAbsentPut(IoObject target, IoObject locals, IoObject message)
        {
            IoMessage m     = message as IoMessage;
            IoObject  key   = m.localsValueArgAt(locals, 0);
            IoObject  value = m.localsValueArgAt(locals, 1);
            IoMap     dict  = target as IoMap;

            if (dict.lookupMap(key) == null)
            {
                dict.map[key.ToString()] = value;
            }
            return(target);
        }
예제 #3
0
파일: IoBDB.cs 프로젝트: MilkTool/io-clr
        public static IoObject slotAt(IoObject target, IoObject locals, IoObject message)
        {
            IoMessage m      = message as IoMessage;
            IoObject  result = null;
            IoObject  symbol = m.localsValueArgAt(locals, 0);
            IoMap     dict   = target as IoMap;

            result = dict.lookupMap(symbol) as IoObject;
            if (result == null && m.args.Count > 1)
            {
                result = m.localsValueArgAt(locals, 1);
            }
            return(result == null ? dict.tag.state.ioNil : result);
        }