private void StackInitializeSuffixes() { AddSuffix("COPY", new NoArgsSuffix <StackValue <T> > (() => new StackValue <T>(this))); AddSuffix("PUSH", new OneArgsSuffix <T> (toPush => InnerEnumerable.Push(toPush))); AddSuffix("POP", new NoArgsSuffix <T> (() => InnerEnumerable.Pop())); AddSuffix("PEEK", new NoArgsSuffix <T> (() => InnerEnumerable.Peek())); AddSuffix("CLEAR", new NoArgsVoidSuffix(() => InnerEnumerable.Clear())); }
public override void LoadDump(Dump dump) { InnerEnumerable.Clear(); List <object> values = ((List <object>)dump[kOS.Safe.Dump.Items]); values.Reverse(); foreach (object item in values) { InnerEnumerable.Push((T)Structure.FromPrimitive(item)); } }
public void Push(T val) { InnerEnumerable.Push(val); }