@@ -0,0 +1,904 @@
+# Rlist class defined for CS61A at UC Berkeley%0A# Edited by Mark Miyashita%0A# http://markmiyashita.com/cs61a%0A%0Aclass Rlist(object):%0A    %22%22%22A recursive list consisting of a first element and the rest.%0A%0A    %3E%3E%3E s = Rlist(1, Rlist(2, Rlist(3)))%0A    %3E%3E%3E len(s)%0A    3%0A    %3E%3E%3E s%5B0%5D%0A    1%0A    %3E%3E%3E s%5B1%5D%0A    2%0A    %3E%3E%3E s%5B2%5D%0A    3%0A    %22%22%22%0A    class EmptyList(object):%0A        def __len__(self):%0A            return 0%0A%0A    empty = EmptyList()%0A%0A    def __init__(self, first, rest=empty):%0A        self.first = first%0A        self.rest = rest%0A%0A    def __repr__(self):%0A        f = repr(self.first)%0A        if self.rest is Rlist.empty:%0A            return 'Rlist(%7B0%7D)'.format(f)%0A        else:%0A            return 'Rlist(%7B0%7D, %7B1%7D)'.format(f, repr(self.rest))%0A%0A    def __len__(self):%0A        return 1 + len(self.rest)%0A%0A    def __getitem__(self, i):%0A        if i == 0:%0A            return self.first%0A        return self.rest%5Bi - 1%5D%0A

Add rlist class to cs61a