Skip to content

Instantly share code, notes, and snippets.

@nulldatamap
Created June 16, 2014 13:58
Show Gist options
  • Select an option

  • Save nulldatamap/06bbba7ad5925c48cb5f to your computer and use it in GitHub Desktop.

Select an option

Save nulldatamap/06bbba7ad5925c48cb5f to your computer and use it in GitHub Desktop.
def macro( f ):
f.__macro__ = True
return f
def lisp( prg ):
if type( prg ) != tuple:
return prg
f = prg[0]
if hasattr( f, "__macro__" ):
return f( *prg[1:] )
return f( *map( lisp, prg[1:] ) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment