Program Structure in LISP Last Updated : 10 Mar, 2023 Comments Improve Suggest changes Like Article Like Report The expressions we use in Lisp are known as the s-expressions which are composed of atoms, strings, and lists. An s-expression is itself a valid program. REPL:REPL is an acronym for Read Evaluate Print Loop. In the case of an interpreter, the program is read, checked for errors in loops, and the value is returned by the program. Lisp program can run either on an interpreter or as a compiled code. Simple Program in Lisp: Lisp ; LISP code for ; Multiplication of 4 number in Lisp (write (* 2 5 8 10)) Time Complexity: O(1)Auxiliary Space: O(1) Output: Prefix Notation in Lisp:Note that in prefix notation the operators are written before the operands.For any operation to be performed, prefix notation is used as in the above example.The '*' symbol above acts as a function that multiplies the numbers together provided as the operands.((a+(b-c))/d) in prefix notation is written as: (/(+ a (- b c) ) d) Example: Lisp ; LISP code for Expression ; ((9+(6-3))/3) (write (/(+ 9(- 6 3))3)) Time Complexity: O(1)Auxiliary Space: O(1) Output: Evaluation of Lisp Program: Evaluation of the Lisp program involves two steps: Reader Program translates program text to Lisp objectsEvaluator Program implements language semantics in terms of the objects.Let us look at the steps of evaluation: Reader translates program text to s-expression.The evaluator defines the syntax of the Lisp forms which are built from s-expressions and also determines which s-expressions are Lisp forms.The evaluator works as a function that takes a valid Lisp form as an argument and evaluates it to a value hence we put the Lisp expression under parenthesis because we send the entire text expression as an argument.Now to begin writing code in Lisp just create a new file as "name.lisp" and write the mentioned code in it: Example: Lisp ; LISP code for ; Hello World Program (write-line "Hello World") Time Complexity: O(1)Auxiliary Space: O(1) Output: Comment More infoAdvertise with us Next Article Structures in LISP K kishanpandeyrkt Follow Improve Article Tags : LISP Similar Reads Structures in LISP LISP, is a list processing, is a programming language widely used in working with data manipulation. Structures are used defines data types, that have the ability to combine with another data type to complete the given task. Attribute used: The defstruct attribute is used to create an instance of a 2 min read Operators in LISP Operators are the foundation of any programming language. Thus the functionality of the LISP programming language is incomplete without the use of operators. We can define operators as symbols that help us to perform specific mathematical and logical computations on operands. In other words, we can 5 min read Predicates in LISP In this article, we will discuss predicates. Predicates are similar to functions that will be used to test their arguments for conditions. They will return NIL if the conditions are not met, if the conditions are met, they will return T. Types of predicates: Below is a list of major Predicates with 5 min read Sequences in LISP In Lisp, the ordered set of elements is represented by sequences. All the functionality we use in sequences is applied on vectors and lists which are two of the subtypes of sequences. Creating a Sequence:The generic function for creating a Sequence in Lisp is: ;The generic function for creating a Se 7 min read Recursion in LISP In the Lisp programming language, recursion is a commonly used technique for solving problems. Lisp is a functional programming language, which means it is well-suited to recursive solutions. In LISP, recursion is a programming technique in which a function calls itself repeatedly until a certain co 4 min read Strings in LISP A string is a set of characters. String  are enclosed in double-quotes. Example: "hello geek","java","python" etc Example: LISP program to display strings Lisp ;edisplay hello geek (write-line "Hello Geek") ;display (write-line "Welcome to java") Output: Hello Geek Welcome to javaString Comparison 4 min read Like