alias

Macro

Package: top-level

Arguments: name args &rest body

This macro is used to define top-level aliases. The syntax of alias is similar to that of defun, and body can be anything acceptable in the body of a lambda expression. name can be a string or a list of a string and options. The string is the name of the top-level alias. If (stringoption*) is used, the options are (either or both may be specified) the keyword :case-sensitive and the integer abbreviation index.

If the :case-sensitive option is chosen, the arguments will be read in case-sensitive mode without regard to the current reader mode. This option is most appropriate when the argument is a filename. Case-sensitivity is fully described in case.htm.

If an abbreviation index is supplied, it must be an integer which is interpreted as an index into the string specified by the string which is either the value of or the first element of name. This index identifies the shortest substring which will stand for the entire command. Note that string indexing is zero-based. For example,

("load" 1)

specifies that lo and loa are valid abbreviations for load, while

("load" 0)

specifies l as well. Note that it is possible that the same substring will be common to more than one command. In that case, the substring calls the most recently defined command. However, no warning is printed when a command is defined that leads to such a conflict.

args is the list of formal parameters to the alias, and has the same form as the formal list of a lambda expression.

An alias can also be defined with setf, in the following way:

  (setf (top-level:alias "foo") 
     #'(lambda (arg) (format t "foo: arg is ~s~%"
  arg))) 

That form has the same effect as:

  (top-level:alias "foo" (arg) 
             (format t "foo: arg is ~s~%"
  arg)) 

This operator is not available in Lisp images built with a minimal top level, that is built with the include-tpl argument to build-lisp-image specified nil. See Minimal top levels in building-images.htm for information on minimal top levels.

See top-level.htm for more information on the top level.

The documentation is described in introduction.htm and the index is in index.htm.

Copyright (c) 1998-2000, Franz Inc. Berkeley, CA., USA. All rights reserved.

Created 2000.10.5.