wisemonkeys logo
FeedNotificationProfileManage Forms
FeedNotificationSearchSign in
wisemonkeys logo

Blogs

LISP - Library Management System

profile
Fatima Shaikh
Jul 16, 2025
4 Likes
7 Discussions
0 Reads

;; Simple Library Management System


;; Global variable to store books

(defvar *library* nil)


;; Function to add a book

(defun add-book (title author)

(push (list title author 'available) *library*)

(format t "~%Added: ~A by ~A" title author))


;; Function to display all books

(defun show-books ()

(format t "~%Library Contents:")

(dolist (book *library*)

(format t "~%Title: ~A, Author: ~A, Status: ~A"

(first book)

(second book)

(third book))))


;; Function to checkout a book

(defun checkout (title)

(let ((book (find title *library* :key #'first :test #'equal)))

(if book

(progn

(setf (third book) 'checked-out)

(format t "~%Checked out: ~A" title))

(format t "~%Book not found: ~A" title))))


;; Test the system

(defun test-library ()

(format t "~%=== Testing Library System ===")

;; Add some books

(add-book "The God of Small Things" "Arundhati Roy")

(add-book "Midnight's Children" "Salman Rushdie")

;; Show all books

(show-books)

;; Checkout a book

(checkout "The Hobbit")

(checkout "Midnight's Children")

;; Show updated library

(show-books))


;; Run the test

(test-library)



Output:



Comments ()


Sign in

Read Next

Virtual Memory

Blog banner

Animal’s have my heart

Blog banner

DATA BREACH CAUSES CHALLENGES PREVENTION AND FUTURE DIRECTIONS

Blog banner

Security requirements for Safe E-Payments

Blog banner

Evolution of Operating system.

Blog banner

Royal enfield

Blog banner

What is Spyware? and examples of them.

Blog banner

Android Flashlight Application

Blog banner

Deadlocks

Blog banner

The War With Cold On Earth

Blog banner

Game via listing method

Blog banner

Deadlock

Blog banner

AI and Cyber Security

Blog banner

Predicting Student Performance with Data Science

Blog banner

Multiprocessor

Blog banner

10 Types of Friends in every friend group

Blog banner

Depression

Blog banner

operating system

Blog banner

Top 5 Benefits of Artificial Intelligence

Blog banner

Capacity management in ITSM

Blog banner

Jio .....A Revolution ?? ??

Blog banner

Virus

Blog banner

Cache Memory

Blog banner

Open relationships

Blog banner

E-security systems | CCTV

Blog banner

Python as a tool for data analysis

Blog banner

memory managment

Blog banner

Why is online marketing is important in current scenario

Blog banner

Social Media Sentiment Analysis

Blog banner

INTRODUCTION TO C#

Blog banner

MORDERN UNIX SYSTEM

Blog banner

Scheduling in Operating Systems

Blog banner

Cyber Laws In India and Around the World

Blog banner

Deadlock

Blog banner

Meal Maharaj — 3 CP, 5 CP, 8 CP. Same Love, Different Portions

Blog banner

Linux -V Server Virtual Machine

Blog banner

Internet of Things

Blog banner

Why we fail after giving 100% ?

Blog banner

Health is Wealth

Blog banner

Music is life

Blog banner

GraphQL

Blog banner

PPC Advertising and its Impressive Benefits

Blog banner