News for hackers. Stuff that matters.
Re:How Lisp macros differ from static code-generation and me... by tom_b on Wednesday January 26, 2011 @12:14PM (#2143941)
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.

Re:How Lisp macros differ from static code-generation and me... by vegashacker on Wednesday January 26, 2011 @12:50PM (#2144107)
Yeah, 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...
Re:How Lisp macros differ from static code-generation and me... by gnosis on Wednesday January 26, 2011 @01:01PM (#2144158)
You'd have to stretch the analogy to not only generating SQL with SQL, but extending SQL with SQL, to create constructs that weren't even possible to write in SQL before you extended it.
Re:How Lisp macros differ from static code-generation and me... by gfodor on Wednesday January 26, 2011 @06:59PM (#2145895)
> If SQL programs were tables, then it'd be a better fit...

Now there's an idea...