That's a different meaning of first-class from Strachey's definition of a first-class citizen[1] - ie, one that can be passed as an argument, returned from a function, or assigned to a variable.
Syntactic macros are still second-class, like Lisp macros, but an improvement over text-replacement style macros.
For something macro-like which is first-class, there are fexprs[2] and operatives (from Kernel[3]) - these receive their operands verbatim, like macros, so they don't require quotation if we want to suppress evaluation. fexprs/Operatives can be passed around like any other value at runtime.
Y_Y|9 months ago
There's also a PEP to make them first-class: https://peps.python.org/pep-0638/
sparkie|9 months ago
Syntactic macros are still second-class, like Lisp macros, but an improvement over text-replacement style macros.
For something macro-like which is first-class, there are fexprs[2] and operatives (from Kernel[3]) - these receive their operands verbatim, like macros, so they don't require quotation if we want to suppress evaluation. fexprs/Operatives can be passed around like any other value at runtime.
[1]:https://en.wikipedia.org/wiki/First-class_citizen
[2]:https://en.wikipedia.org/wiki/Fexpr
[3]:https://web.cs.wpi.edu/~jshutt/kernel.html
matheusmoreira|9 months ago