Dear Lispers,
Is it possibly to easily bind an existing function to a symbol, in such a way that that the symbol can be used synonymously with the original function/symbol, specifically for the lexical environment?
What I'd want to do is this:
Code: Select all
(labels ((cow () "cow"))
(flet ((chicken #'cow))
(list (cow) (chicken))))
--> ("cow" "cow")
So basically, for the code block inside the chicken binding, I want chicken to be synonymous to cow. I've looked up symbol-function, and it looked promising, but from what I understood it's only for the global bindings and not for lexical function-bindings as created by labels. Does anyone know if this can be done (my gut feeling says it should be possible, somehow

)? My goal is to create a small macro block where certain helper-functions are bound and usable (and with one that should have two names). I tried searching for this, but haven't been able to find this question asked elsewhere.
Best Regards,
Richard