# TITLE: # Stackable # # DESCRIPTION: # Stackable mixin. # Stackable mixin provides #pop, #push, #pull, etc. # It depends on #slice, #splice and #insert. module Stackable # def pop splice(-1) end # def push(x) insert(-1,x) end # def pull slice(0) end alias :shift :pull # def poke(x) insert(0,x) end alias :unshift :poke # def peek splice(-1) end end