# 5 minutes Lisp in Python# Pepijn de Vos <http://pepijndevos.nl>## Inspired by 30 minutes Lisp in Ruby# http://gist.github.com/562017# # This Lisp does not read or parse anything at all.# A generator and a Decorator are abused to run sexps.## Usage:# # Define a function decorated with @lisp and start every sexp with yield.## The function names should be strings.## Result is stored in fn name.## Example below:#deflisp(fn):code=fn()val=code.next()whileTrue:try:try:newval=getattr(__builtins__,val[0])(*val[1:])exceptAttributeError:newval=getattr(val[1],val[0])(*val[2:])val=code.send(newval)exceptStopIteration:returngetattr(val[1],val[0])(*val[2:])@lispdefexample():(yield'join',", #",(yield'__mul__',[(yield'str',i)foriin(yield'range',(yield'__add__',5,5))],2))printexample