by daeken · 15y ago · 0 comments
https://github.com/daeken/Transformana/blob/master/test.py shows off various features if you're interested.
Edit: Here's the output from running the test, in case you want to see the AST format.
Hello world!
Yep, working.
Don't know.
['function',
None,
'test2',
(),
(),
0,
None,
['stmt', [['printnl', [['const', 'Hello from test2']], None]]]]
Hello from test2
['function', None, 'test3', (), (), 0, None, ['stmt', [['printnl', [['const', 'This should never be callable']], None]]]]https://github.com/built/Jane-Kelly/blob/master/guard.py
It'll let you redefine functions with different guard parameters. (@when("x=5"), @when("x>20"), etc.) Like you, I would also shudder to see this in production. But it was fun and shows off some of what's possible.