So as a result, most of the program became whitespace irrelevant. Huge dicts of lists of tuples, etc. It made me think that relevant whitespace might become handy for data too. And while talking on IRC about it this morning I realized I could sortof hack it using decorators and generators. So here's what it looks like:
http://gist.github.com/611646
So I have two examples:
- example.py - This shows how you can define a more complicated structure with whitespace instead of a bunch of ){(}[].
- inlinefunc.py - This demonstrates a sort of side-effect benefit. You can have multi-line functions inline in a list (or tuple or dict). Usually you're stuck with lambdas, and of course that starts to look confusing too.
Any thoughts?
No comments:
Post a Comment