Structures in LISP Last Updated : 29 May, 2022 Comments Improve Suggest changes Like Article Like Report 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 structure.The setf attribute is a macro that calls the function.The setq attribute store the variable.The terpri attribute to produce a new line.Example 1: Lisp /* LISP Creating a book.lisp file to /* store the information of book. (defstruct book title author book-id ) ( setq book1 (make-book :title "Geek Programming" :author "Ayush Agarwal" :book-id "101") ) ( setq book2 (make-book :title "Harry Potter" :author "J. K.Rowling" :book-id "102") ) (write book1) (terpri) (write book2) (setq book3( copy-book book1)) (setf (book-book-id book3) 100) (terpri) (write book3) Output: Example 2: Lisp /* Creating a Staff.lisp file to store /* the information of Staff working in a company. (defstruct Staff employee salary Pin-code ) ( setq employee1 (make-Staff :employee "Rahul Raj" :salary "20 thousand" :Pin-code "700055") ) ( setq employee2 (make-Staff :employee "Dhruv Rathee" :salary "10 thousand" :Pin-code "400020") ) (write employee1) (terpri) (write employee2) (setq employee3( copy-Staff employee1)) (setf (Staff-Staff-id employee3) 100) (terpri) Output: Comment More infoAdvertise with us Next Article Program Structure in LISP A ayushcoding100 Follow Improve Article Tags : LISP LISP-Basics Similar Reads Program Structure in LISP 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 val 2 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 Tree in LISP A tree is a non-linear hierarchical data structure that consists of nodes that are connected by edges. Tree stores data in a non-sequential manner so that operations like addition, deletion, updating, or searching could be performed in much less time than what it would take in linear data structures 5 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 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 Lists in LISP Lists in common LISP is simply a single Linked list. In LISP, Lists are designed as a chain of records. While talking about record structures in LISP, the concept of Cons is vital. Cons in LISP is a record structure with 2  primary components. A cons function takes in 2 arguments and returns a new c 2 min read Like