LISP is a family of computer programming languages with a long history, fully parenthesized Polish prefix notation.Lisp is specified in 1958.Lisp is the second-oldest high-level programming language in widespread use today; only Fortran is older (by one year). Like Fortran,The name LISP derives from "LISt Processing". Linked lists are one of Lisp language's major data structures, and Lisp source code is itself made up of lists. LISP expressions are composed of forms. The most common LISP form is function application. LISP represents a function call f(x) as (f x). For example, cos(0) is written as (cos 0).LISP expressions are case-insensitive. It makes no difference whether we type (cos 0) or (COS 0).Some functions, like "+" and "*", could take an arbitrary number of arguments. In our example, "*" took three arguments. It could as well take 2 arguments, as in "(* 2 3)", or 4 arguments, as in "(* 2 3 4 5)".Numeric values like 4 and 6 are called self-evaluating forms: they evaluate to themselves.
Defining a function in LISP :
(define (add a b)
(+ a b))
(add 3 4) #4Lisp interpreter in Python : LISP.py .(for more details click here)
Lisp interpreter in JavaScript : LISP.js
No comments:
Post a Comment