freenode/#sicl - IRC Chatlog
Search
9:25:35
beach
So, CL:CADR and CADR is one and the same symbol. There are no package tricks involved.
9:28:27
no-defun-allowed
There are translator methods for set-symbol-value-ast and setq-ast, but neither looks applicable for symbol-function.
9:31:17
beach
So here is the theory: I import most things from the host, where "things" are functions, macros, and special operators.
9:31:59
beach
The compiler looks things up in the environment. In particular macros, that it expands as a compiler would do.
9:33:40
beach
When I translate the AST back to Common Lisp, I don't translate the FDEFINITION-AST as FDEFINITION. I translate it as a call to sicl-genv:fdefinition in the first-class global environment that we are working with.
9:34:35
Harag
is the tree-walker ie cst to ast needed so that you have a compile/eval that uses the first class environment definitions and not the host definitions of functions?
9:34:39
beach
So any reference to a function, and that should include #'... is looked up in the environment we are working with.
9:35:29
beach
So if you have a form that calls the function named CL:CADR, that function is going to be looked up in the environment.
9:36:53
beach
So in the code that the user types, CADR and CL:CADR are the same. You can't escape to the host environment.
9:37:32
beach
In other words, only things present in the first-class global environment are available to the user.
9:38:13
beach
Now, this is just a demo, so you can do #.(cadr...) since it is then evaluated by the reader.
9:44:57
Harag
I am trying to think of ways to get rid of code-walking (just to cut down on dependencies) using eclector, but I wanted to make sure I understood what problems the code walker handled for me.
9:46:09
Harag
the one problem I cant really solve in my head if I only use eclector is the (let ((caddr ..)))
9:46:26
beach
So in essence, it finds all references to functions, no matter how deeply buried in macros they are, and it replaces those references by an access to the environment.
9:47:42
beach
For that particular case, the technique I propose identifies it as a variable, so no problem.
9:48:08
beach
And again, I play no package tricks, so it is the Common Lisp symbol being referred to.
9:50:47
beach
Harag: I am about to take a break for lunch, so if you have any more questions, now is a good time to ask them. :)
9:53:17
Harag
no its fine, my choices are go for the simple but with limitation, or do it with a prorper code walker , which means use sicl bits and pieces or reinventing the wheel
9:54:42
Harag
I found agnostic lizard last night but have not read the docs yet, first wanted to understand what I really needed and what not