在Lisp中可以使用函数名的别名吗? [英] Is it possible to have an alias for the function name in Lisp?

查看:113
本文介绍了在Lisp中可以使用函数名的别名吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

...就像套餐一样。

...just like packages do.

我使用Emacs(也许可以提供某种解决方案)。

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

例如(defun the-very-very-long-but-good-name()...)稍后在代码中不起作用。但是,像 Fn-15 或首字母缩写的名称也不太有用。
尝试回调该函数的名称时,是否可以使用类似于包的别名或访问文档字符串?

For example (defun the-very-very-long-but-good-name () ...) is not to useful later in code. But the name like Fn-15 or the first letters abbreviation is not useful too. Is it possible either to have an alias like for packages or to access the documentation string while trying to recall the function's name?

换句话说,是吗可能的功能是混合某种自我记录和短名称?

In other words, is it possible for functions to mix somehow self-documenting and short names?

推荐答案

你想要 defalias (defalias'newname'oldname)将保留文档,甚至显示newname是oldname的别名,当它的文档被请求时。

You want defalias. (defalias 'newname 'oldname) will preserve documentation and even show "newname is an alias for `oldname'" when its documentation is requested.

这篇关于在Lisp中可以使用函数名的别名吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆