Defun
Encyclopedia
defun is a macro in the Lisp family of programming languages that defines a function
in the global environment
that uses the form:
Defining the function
defining function
and defining a function that returns the
Subroutine
In computer science, a subroutine is a portion of code within a larger program that performs a specific task and is relatively independent of the remaining code....
in the global environment
Global variable
In computer programming, a global variable is a variable that is accessible in every scope . Interaction mechanisms with global variables are called global environment mechanisms...
that uses the form:
Defining the function
addnumbers
that adds two numbers:defining function
square
that squares a number:and defining a function that returns the
factorialFactorialIn mathematics, the factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n...
of a number
:See also
- define
- defmacro
- lambda in PythonPython (programming language)Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive...
and Lisp
External links
-
defun
in Emacs LispEmacs LispEmacs Lisp is a dialect of the Lisp programming language used by the GNU Emacs and XEmacs text editors . It is used for implementing most of the editing functionality built into Emacs, the remainder being written in C...