Cons box implementation
问题 I cannot seem to figure out a way to do Scheme's cons boxes in Ruby (it seems its pretty much all arrays). This is a pretty rough outline: class cons def initialize (car, cdr) @car = car @cdr = cdr end #return the car of the pair def car return @car end #return the cdr of the pair def cdr return @cdr end end I can pass two values and call the car and cdr , but this is not a list of any sort (just two values). How do I make a list on which I can insert something as in Scheme cons: myCons =