Why Nostr? What is Njump?
2023-09-10 20:05:15

Karsten Johansson on Nostr: Why doesn't #Python have #Lisp style macros? For example, here is something that ...

Why doesn't #Python have #Lisp style macros?

For example, here is something that should be able to be used in code generation:

s = "This is a string that I want to turn into a list"
print(s.split(' ', -1))

It's a lame example, but it shows the point cleanly. With a Lisp style macro, I would be able to compile this as a list, instead of creating the lisp at runtime every time.

There doesn't really seem to be anything stopping Python from being able to do this, except the lack of implementation.

Or is it there, and I just don't know about it yet?

Maybe a related question: Does Python have something like Lisp's (compile ....) because that would immediately call for Lisp style macros!
Author Public Key
npub1cyvzp4s84chk996ud3lqzmch03w9czjtk24r3fre3hx3gthk6khspdu5q2