News for hackers. Stuff that matters.
Re:Just what does “code as data” mean anyway? (2014) by accatyyc on Friday February 16, 2018 @11:14AM (#16393350)
I think there’s a much simpler example of how code is data:

    (hello world)
That’s a list containing two symbols. So it’s data. However, if I evaluate that list, it will call the function “hello” with the argument “world”. So it’s also code.

Incidentally, lists and function calls are identical in lisp, hence code is data.

I think the article just complicates it by introducing macros.

Re:Just what does “code as data” mean anyway? (2014) by rootlocus on Friday February 16, 2018 @11:23AM (#16393423)

    '(hello world)
is a list

    (hello world)
is a function call
Re:Just what does “code as data” mean anyway? (2014) by junke on Saturday February 17, 2018 @02:33AM (#16399545)
Typically when writing about lisp code, it is also correct to talk about how "read" sees the expression, to avoid some confusion about what happens after "eval". That's how I interpret the parent comment when it says that (hello world) is a list of two elements.
Re:Just what does “code as data” mean anyway? (2014) by Karunamon on Friday February 16, 2018 @01:40PM (#16394672)
Well, technically they're both lists, it's just that the ' prefix makes it a list literal rather than having the compiler try to macro expand it. A bit pedantic, but of massive importance when macros are in play.
Re:Just what does “code as data” mean anyway? (2014) by tincholio on Saturday February 17, 2018 @12:35PM (#16401673)
Evaluate it, not macro expand it ;)