Copyright (C) 2000-2012 |
GNU Info (librep.info)Defining FunctionsDefining Functions ------------------ Globally accessible functions are usually defined by the `defun' special form. - Macro: defun name lambda-list body-forms... `defun' initialises the function definition of the symbol NAME to the lambda expression resulting from the concatenation of the symbol `lambda', LAMBDA-LIST and the BODY-FORMS. The BODY-FORMS may contain a documentation string for the function as its first form and an interactive calling specification as its first (if there is no doc-string) or second form if the function may be called interactively by the user (Note: Lambda Expressions). An example function definition taken from the `librep' source code is: (defun load-all (file) "Try to load files called FILE (or FILE.jl, etc) from all directories in the Lisp load path." (mapc (lambda (dir) (let ((full-name (expand-file-name file dir))) (when (or (file-exists-p full-name) (file-exists-p (concat full-name ".jl")) (file-exists-p (concat full-name ".jlc"))) (load full-name nil t)))) load-path)) automatically generated by info2www version 1.2.2.9 |