▲ | diggan 5 days ago | ||||||||||||||||
> There is not 2 different kinds of code In Python in relation to ast, it does seem so yeah. If you add two numbers in Python code, it looks like `1 + 1`, but if you use the module from `Lib/ast.py` linked above, how would it look like? I think it would be something like `Expression(body=BinOp(left=Name(id='x',ctx=Load()),op=Add(),right=Name(id='y', ctx=Load())))` which at a glance, certainly looks different than `1 + 1` in my eyes :) In lisps, `(+ 1 1)` is just `(+ 1 1)` regardless if it's source code or AST, they're just the same thing. | |||||||||||||||||
▲ | charcircuit 4 days ago | parent [-] | ||||||||||||||||
(cons '+ (cons 1 (cons 1 nil))) doesn't look like (+ 1 1). | |||||||||||||||||
|