3 ms·
At least part of the significance of Lisp macros is that they let you use the full facilities of the language at compile time. Your method doesn't really do any
by silentbicycle 18y ago
At least part of the significance of Lisp macros is that they let you use the full facilities of the language at compile time. Your method doesn't really do anything but run another Python instance at runtime (assuming there is one available) on a generated file of Python code. You could use eval(str) for that, by the way.
You couldn't use this to, say, allow Python's lambda to take multiple lines, or generate boilerplate code at compile time.