Exemple #1
0
        internal Object ReadBackQuote(params Object[] args)
        {
            LocTextReader t    = (LocTextReader)args[0];
            Int32         line = t.line;
            Object        ret  = Cons.MakeList(interpreter.BACKQUOTE, doRead(t, false));

            //record the location
            locTable[ret] = new Loc(t.file, line);
            return(ret);
        }
Exemple #2
0
        internal Object splitSymbol(String s)
        {
            //turn x[y] into ([y] x) - can we with readvector in place?
            //Int32 bridx = s.LastIndexOf("[");


            Int32 dotidx   = s.LastIndexOf(".");
            Int32 colonidx = s.LastIndexOf(":");

            //dot in the middle and not member(dot at start) or type(dot at end)
            if (dotidx >= 0 && dotidx > colonidx && dotidx < (s.Length - 1) && s[0] != '.')
            {
                //turn x.y into (.y x)

                return(Cons.MakeList(interpreter.intern(s.Substring(dotidx)),
                                     splitSymbol(s.Substring(0, dotidx))));
            }
            return(interpreter.intern(s));
        }
Exemple #3
0
        internal Object ReadUnquote(params Object[] args)
        {
            LocTextReader t    = (LocTextReader)args[0];
            Int32         line = t.line;
            Int32         ch   = t.Peek();
            Object        ret  = null;

            if (ch == '@')
            {
                t.Read();
                ret = Cons.MakeList(interpreter.UNQUOTE_SPLICING, doRead(t, false));
            }
            else
            {
                ret = Cons.MakeList(interpreter.UNQUOTE, doRead(t, false));
            }
            //record the location
            locTable[ret] = new Loc(t.file, line);
            return(ret);
        }