3 ms·
Reading about Sweet.js made me really, really want such a thing in Python. I recognise that such a thing would run completely counter to Python's 'no magic' cu
by thristian 14y ago
Reading about Sweet.js made me really, really want such a thing in Python.
I recognise that such a thing would run completely counter to Python's 'no magic' cultural values, but structural search-and-replace seems such an intoxicatingly powerful tool, I'd like to at least have the option to abuse it.
- iso8859-1 14y agoSo use Perl :) The thing about Perl is that there is supposed to be more than one way to do it. Which enables you to mix-and-match different paradigms in a way that the Python philosophy doesn't seem to welcome. Or just use a Lisp.
- andrewaylett 14y agoI'd suggest that metaclasses are Python's 'equivalent' for magically mutating things.
- byroot 14y agoI'm pretty sure I seen someone doing python macros using a custom codec: http://docs.python.org/library/codecs.html http://docs.python.org/library/codecs.html