4 ms·
An excellent way of looking at it. Hy is essentially a self-evaluating macro that spits out Python AST. So you can use map, filter, and friends just as easily
by agentultra 12y ago
An excellent way of looking at it.
Hy is essentially a self-evaluating macro that spits out Python AST.
So you can use map, filter, and friends just as easily on Hy code as you can elements in a list or tuple.
In the end you get Python AST. We generate all of the boiler plate instead of writing it out.
You also do "have" macros in a very obtuse way in Python. You have eval, compile, and the ast module. You can write code, in Python, to modify or generate Python code. It's just tedious and cumbersome in a language where the code is not also data.
- pekk 12y ago> You have eval, compile, and the ast module. Using this to write normal code is also a bad idea and a maintenance nightmare. The issue isn't that it is tedious and cumbersome to do so. If it's tedious and cumbersome to make my life hell, that's a feature.
- agentultra 12y agoOh... you must ban the use of the namedtuple function in the collections module then. How unfortunate. It's pretty useful.