News for hackers. Stuff that matters.
Re:Why Lisp Syntax Works by umanwizard on Tuesday June 06, 2023 @01:15AM (#36208401)
Code is also data in C++, because a source file is a vector of bytes, which is a type of data that C++ can manipulate.

I think when people say “code is data” what they really mean is something more specific, like the AST is easy to access and manipulate in the language.

Re:Why Lisp Syntax Works by freilanzer on Tuesday June 06, 2023 @09:28AM (#36212382)
When people say 'code is data' they obviously don't mean that source code is stored in a text file which consists of bytes...

(def add (x y) (+ x a))

(def sub (x y) (- x y))

(add 1 2) # 3

(sub 1 2) # -1

(first '(add 1 2)) # 'add

(rest '(add 1 2)) # (list 1 2)

(apply 'sub (rest '(add 1 2))) # -1

(reverse '(add 1 2) # '(2 1 add)

Excuse my pseudo lisp quote syntax, it's been a while.