Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

emacs

lisp

...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 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?

like image 717
avp Avatar asked Oct 10 '08 16:10

avp


People also ask

What is an alias variable?

An alias occurs when different variables point directly or indirectly to a single area of storage. Aliasing refers to assumptions made during optimization about which variables can point to or occupy the same storage area.

Is Emacs Lisp the same as Lisp?

Emacs Lisp is a dialect of the Lisp programming language used as a scripting language by Emacs (a text editor family most commonly associated with GNU Emacs and XEmacs). It is used for implementing most of the editing functionality built into Emacs, the remainder being written in C, as is the Lisp interpreter.


1 Answers

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

like image 182
Allen Avatar answered Oct 08 '22 22:10

Allen