4 ms·
Lisp macros remind me of dynamically generating SQL statements. If you've ever built a string in T-SQL or PL/SQL and then exec'd it, you're probably much close
by tom_b 16y ago
Lisp macros remind me of dynamically generating SQL statements.
If you've ever built a string in T-SQL or PL/SQL and then exec'd it, you're probably much closer to being productive with macros than you think.
Of course, this is probably because dynamically generating SQL is something that I've done. Other programmers probably have their own mental models that warp into lisp.
- vegashacker 16y agoYeah, I think that's a fair way to start thinking about them. But Lisp macros, to extend your example, are more like if you could generate the SQL using SQL. Which sounds like a totally horrible thing actually. :) But with Lisp it makes much more sense because lisp programs are lists. If SQL programs were tables, then it'd be a better fit...