Defstruct in LISP Last Updated : 24 Jul, 2022 Comments Improve Suggest changes Like Article Like Report A structure is a user-defined data type that helps us combine different data items of different types under the same name. In Lisp, defstruct is used to define a structure of multiple data items of different data types. Syntax: (defstruct studentnameclassroll-nobirth-date) In the above declaration, we have defined four named components for the structure student.The named components take the argument in them through named functions.An implicit function named copy-book of one argument is also defined which takes a student instance and creates another student instance, which is a clone or copy of the first one. This function is known as the copier function.Another implicit function named make-student will be created, a constructor, which will create a data structure with four components, suitable for use with the access functions.To read or print the instances of 'student' we can use #S syntax which itself refers to a structure.To alter the components of the structure 'student' we can use self as we would use below.Example: Lisp ; LISP program for destruct (defstruct student name class roll-no birth-date ) ( setq student1 (make-student :name"Kishan Pandey" :class "12" :roll-no "102016114" :birth-date "31-08-2002") ) ( setq student2 (make-student :name"Sakshi Tripathi" :class "12" :roll-no "102016115" :birth-date "14-03-2000") ) (write student1) (terpri) (write student2) (setq student3( copy-student student1)) (setf (student-roll-no student3) 102016116) (terpri) (write-line "A Copy of the first student is:") (write student3) Output: Comment More infoAdvertise with us Next Article Defstruct in LISP K kishanpandeyrkt Follow Improve Article Tags : LISP LISP-Basics Similar Reads Cond Construct in LISP In this article, we will discuss cond construct in LISP. The cond is a decision-making statement used to make n number of test conditions. It will check all the conditions. Syntax: (cond (condition1 statements) (condition2 statements) (condition3 statements) ... (conditionn statements) ) Here, The c 2 min read Dolist Construct in LISP DoList in Common LISP is a looping statement used to iterate the elements in a list. Syntax: (dolist input_list) statements... ) Here, The input_list contains the list of elements that are iterated.The statements are present in the loop. Example 1: LISP Program to iterate the list of elements from 1 2 min read Introduction to LISP Lisp is a programming language that has an overall style that is organized around expressions and functions. Every Lisp procedure is a function, and when called, it returns a data object as its value. It is also commonly referred to as "functions" even though they may have side effects. Lisp is the 2 min read Loop For Construct in LISP The loop for construct in common LISP is used to iterate over an iterable, similar to the for loop in other programming languages. It can be used for the following: This is used to set up variables for iteration.It can be used for conditionally terminate the iteration.It can be used for operating on 2 min read Constants in LISP In LISP all constants are global variables. Values of constant never change throughout the execution of the program. Defining constant in LISP: New global constants are defined using the DEFCONSTANT construct Syntax: (defconstant name initial-value-form "documentation-string") Example: Let's create 2 min read Like