Skip to content

Instantly share code, notes, and snippets.

@Sourceless
Created March 12, 2013 14:36
Show Gist options
  • Save Sourceless/5143391 to your computer and use it in GitHub Desktop.
Save Sourceless/5143391 to your computer and use it in GitHub Desktop.
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