Created
March 12, 2013 14:36
-
-
Save Sourceless/5143391 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class cons: | |
"""A LISP-like cons cell, composed of two items.""" | |
def __init__(self, car, cdr=None): | |
self.car = car | |
self.cdr = cdr | |
def __repr__(self): | |
return "({car}, {cdr})".format(car=self.car, cdr=self.cdr) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment