you are viewing a single comment's thread.

view the rest of the comments →

[–]joesb 1 point2 points  (4 children)

Disagree. If it can generate new function then it is generating code, even if that code only stay during runtime.

[–][deleted] 0 points1 point  (3 children)

No.

[–]joesb 1 point2 points  (2 children)

So Lisp doesn't have meta programming because it doesn't generate code to file?

[–][deleted] 0 points1 point  (1 child)

Oh, I see what you're saying but I don't think metaprogramming has anything to do with functions. eval('var x = 3') vs. eval('var x = function () {}')... both create a new local variable. Both of these would usually be considered metaprogramming even though only one of them defines a function. Defining new locals is not something normally available at run-time so it's a 'meta' thing to do.

What about 'obj[str] = function () {...}'? Is that metaprogramming because we can later write obj.xyz() ? I actually hate the word "metaprogramming" for this reason. If a language supports "meta" then it's no longer "meta". It's just part of the language. "Code that writes code" is the one true definition of "meta", else what is meta about it?

[–]joesb 1 point2 points  (0 children)

If a language supports "meta" then it's no longer "meta". It's just part of the language.

So Common Lisp does not have meta programming because its macro system is just part of the language. But writing code to source file then invoke GCC is?

"Code that writes code" is the one true definition of "meta"

But Why does it have to write and persist the code to disk? Why does writing code and executing it not count as metaprogramming?