Skip to content

Instantly share code, notes, and snippets.

@obriencj obriencj/more spexy repl
Last active Jan 4, 2016

Embed
What would you like to do?
This is how I roll on a Friday night, getting crazy up in here.
maybe:python-spexy siege$ PYTHONPATH=./ python
Python 2.7.6 (default, Nov 18 2013, 15:12:51)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from spexy import repl
>>> from datetime import datetime
>>> repl(globals())
>>>> (let ((who "siege") (date 1999))
(letrec ((fmt "Hello %s, party like it is %i!")
(msg (% fmt (make-tuple who date))))
(println msg)))
--> ((lambda who, date: ((lambda fmt, msg: (fmt.__setitem__(0, "Hello %s, party like it is %i!"), msg.__setitem__(0, (fmt[0] % (who[0], date[0],))), __import__('sys').stdout.writelines(map(str, (msg[0], '\n'))),)[-1])([None], [None])))(["siege"], [1999]))
Hello siege, party like it is 1999!
>>>> (println "But..." "it isn't" 1999 "anymore, it's" (. (datetime.now) year))
--> __import__('sys').stdout.writelines(map(str, ("But...", " ", "it isn't", " ", 1999, " ", "anymore, it's", " ", datetime.now().year, '\n')))
But... it isn't 1999 anymore, it's 2014
>>>> (quit)
>>> quit()
maybe:python-spexy siege$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.