Is that possible to convert code to a list in CLOS? That is; is it possible to build a function that takes an argument f, which should be a function or method, and converts it to a List?
The goal would be to visit the list elements in the same way the Design Pattern Visitor is used to visit the nodes of the Abstract Syntax Tree of a function during compilation.
(get-code (lambda (x) (+ x 1)))
should return`(lambda (x) (+ x 1))
. Expression(let* ((y 3) (z (compile (lambda (x) (+ x y)))) (get-code z))
should return`(lambda (x) (+ x y))
. And(get-code #'car)
should issue an error since car is not implemented in Lisp. – José De Oliveira Guimarães Jun 15 '18 at 13:50