Is it possible to have an alias for the function name in Lisp?

后端 未结 8 1406
梦毁少年i
梦毁少年i 2021-02-05 20:37

...just like packages do.

I use Emacs (maybe, it can offer some kind of solution).

For example (defun the-very-very-long-but-good-name () ...) is no

8条回答
  •  时光说笑
    2021-02-05 21:15

    You could use setf to assign the function to the function cell of another, for example:

    (defmacro alias (new-name prev-name)
      `(setf (symbol-function ,new-name) (symbol-function ,prev-name))) 
    

提交回复
热议问题