Example #1
0
        public static bool SystemVectorSize(out object answer, object arg)
        {
            ISystemVector sysVec = arg as ISystemVector;

            if (sysVec != null)
            {
                answer = sysVec.SystemVectorSize;
            }
            else if (arg is bool [])
            {
                answer = (((bool [])arg).Length / 32) + 1;
            }
            else if (arg is int)
            {
                answer = 0x1000;
            }
            else if (arg is long)
            {
                answer = 0x2000;
            }
            else if (arg is double)
            {
                answer = 2;
            }
            else
            {
                throw new NotImplementedException();
            }
            return(false);
        }
Example #2
0
        public object SystemVectorRef(int index)
        {
            ISystemVector firstVec  = ((ISystemVector)first);
            int           firstSize = firstVec.SystemVectorSize;

            return((index < firstSize) ? firstVec.SystemVectorRef(index)
                : (rest == null) ? Fakeup(index)
                : rest.SystemVectorRef(index - firstSize)
                   );
        }
Example #3
0
        public static bool SystemVectorRef(out object answer, object arg, object offset)
        {
            ISystemVector sysVec = arg as ISystemVector;

            if (sysVec != null)
            {
                answer = sysVec.SystemVectorRef((int)offset);
            }
            else
            {
                throw new NotImplementedException();
            }
            return(false);
        }
Example #4
0
        public static bool SystemSubvectorToList(out object answer, object arg, object start, object end)
        {
            ISystemVector sysVec = arg as ISystemVector;

            if (sysVec != null)
            {
                Cons result = null;
                for (int i = (int)end - 1; i > ((int)start - 1); i--)
                {
                    result = new Cons(sysVec.SystemVectorRef(i), result);
                }
                answer = result;
                return(false);
            }
            else
            {
                throw new NotImplementedException();
            }
        }