public override ReaderMacroStep NextStep() { Cons head = null; object tail = null; Readtable currentReadtable = CL.Readtable; while (true) { int xx; char x; // Discard whitespace do { xx = this.context.InputStream.Peek(); if (xx == -1) { throw new NotImplementedException(); } else { x = (char)xx; } }while (currentReadtable.IsWhitespaceSyntax(x) && (this.context.InputStream.Read() != -1)); if (x == ')') { this.context.InputStream.Read(); // discard the close paren return((CL.ReadSuppress == true) ? new FinalReaderMacroStep() : new FinalReaderMacroStep(CL.Reconc(head, tail))); } //else if (x == '.') { // throw new NotImplementedException (); //} else { object next = CL.Read(this.context.InputStream, true, null, true); // recursive read if (CL.ReadSuppress != true) { head = CL.Cons(next, head); } } } }
public static ConsCollection <T> Append <T> (System.Collections.Generic.IList <T> left, ConsCollection <T> right) { return(CL.Reconc <T> (CL.Reverse <T> (left), right)); }
// Append public static object Append(object left, object right) { return(CL.Reconc(CL.Reverse(left), right)); }
static public object Reverse(object list) { return(CL.Reconc(list, null)); }
static public ConsCollection <T> Reverse <T> (System.Collections.Generic.IList <T> list) { return(CL.Reconc <T> (list, null)); }
static public Cons Reverse(Cons list) { return((Cons)CL.Reconc(list, null)); }